Wamp (Apache) redirects calls on subdirectory php files to parent directory -


on local dev machine running wamp, strange behaviors.

  • when call ajax call /phplib/login.php page, wamp (apache) redirect /login.php.
  • the result same when call /phplib/login.php page directly browser.
  • for information don't use .htaccess file.
  • the same code running on centos machine apache (site located in /var/www/html) works fine.

i've searched hours can't find reason. help.

possible causes this:

  • you have rewrite rule in server somewhere (.httpd-conf, vhosts configuration etc) rewriting url
  • there file root_directory/phplib/login.php redirecting root_directory/login.php
  • you unknowingly changing form's action /login.php via javascript written long ago or similar
  • you have application-level route redirects /phplib/login.php /login.php

how debug

  1. terminate php execution on first line in /phplib/login.php
  2. use decent webdev tool , make sure request sent /phplib/login.php initially.
  3. see server response code is.

if request not sent @ right url initially, means client side messing request path.
if server responds 3xx code, means server configuration rewriting url somewhere.
if blank screen response code 200, means script has been called , exited on first line, mean application redirecting.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -