php - apache basic auth breaks rewrite in .htaccess -


rewriting works fine until add auth htaccess. auth formatted correctly? why rewrite work before adding auth?

request params @ site controller no auth:

[id] => 433    [type] => city 

params after auth added , user authenticated:

[site/query] 

sample query url works without auth:

http://www.website.com/site/query?type=city&id=433 

the .htaccess basic auth @ bottom:

# visits not coming official url should rerouted; ajax cross-domain, www.website.com not same our.company.com rewriteengine on rewritecond %{http_host} !^www\.website\.com$ [nc] rewriterule ^(.*)$ http://www.website.com/$1 [r=301,l]  # route requests not static files, through index.php make /nice/urls/ work rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?$1 [l]  # disable file listings directories options -indexes  # disable fetching of .phtm <files ~ "\.phtml$">   order allow,deny   deny </files>  # protect hidden files being viewed <files .*>     order deny,allow     deny </files>  # protect application , system files being viewed rewriterule ^(?:modules|system)\b.* index.php/$0 [l]  # allow files or directories exist displayed directly rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d  authtype basic authname "password required" authuserfile /maps/scorp/main/.htpasswd require valid-user 

i've got no answer nice questions hope found solution. :)

imho in .htaccess authorisation take advantage. it's kinda tricky can break priority enclosing "require valid-user" directive block <files>. e.g.:

<files "*.phtml">     require valid-user </files> 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -