When I make the request:
http://localhost/project/mycontroller/
URL rewrites to
http://localhost/project/mycontroller/?l=mycontroller
That is, in addition to /mycontroller
the .htaccess (I suppose) is concatenating in the url the same parameters of GET
only in the unfriendly way.
Note 1: l
is my variable of $_GET
same and everything works perfectly even if I mess with the non-friendly URL.
Note 2: First I thought it was a redirect, but I put a exit()
on the first line of the index and even then the URL continued to rewrite the unfriendly part.
How to solve this?
.htaccess
<Files magic>
ForceType application/x-httpd-php5
</Files>
<IfModule mod_rewrite.c>
RewriteEngine On
Header append Vary User-Agent
#?l=local -> /local
RewriteRule ^([a-z0-9_]+)$ ?l=$1 [NC,L]
RewriteRule ^([a-z0-9_]+)/$ ?l=$1 [NC,L]
#?l=local&sl=sublocal -> local/sublocal
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)$ ?l=$1&sl=$2 [NC,L]
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/$ ?l=$1&sl=$2 [NC,L]
#?l=local&sl=sublocal&cod=1 -> local/sublocal-1
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/([0-9]+)$ ?l=$1&sl=$2&cod=$3 [NC,L]
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/([0-9]+)/$ ?l=$1&sl=$2&cod=$3 [NC,L]
#?l=local&sl=sublocal&cod=1 -> local/sublocal/var
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/([a-z0-9]+)$ ?l=$1&sl=$2&var=$3 [NC,L]
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/([a-z0-9]+)/$ ?l=$1&sl=$2&var=$3 [NC,L]
</IfModule>