Hi im trying to rewrite myweb.com/ivan to a simple url.
I got this on .htaccess in my root directory:
RewriteEngine On
RewriteRule ^/something$ index.php?page=anunciante&anunciante=something [L,NC]
RewriteRule (.*)/?restaurantes/(.+)?$ index.php?page=anunciante&anunciante=something [L,NC]
Yes, both are the same. If i try to enter myurl.com/ivan i get ‘Not found’,but if i try to enter myurl.com/restaurantes/something i get into index.php with no problem. In my index.php i have this:
print_r($_GET); die();
So with myurl.com/restaurantes/something i get:
Array ( [page] => anunciante [anunciante] => something )
(like expected)
But i dont know why this not work with myurl.com/ivan
I also tried modifying the rule like:
RewriteRule ^/?ivan$ index...
RewriteRule ^ivan$ index...
RewriteRule ^/ivan index...
All no succed. Also i dont know where is asking for ‘favicon.ico’..
And here is the mod_rewrite log:
asking for myurl.com/something
Log: http://pastebin.com/283kq3R8
asking for myurl.com/restaurantes/something
http://pastebin.com/5QcyuAuW
As posted by @Gerben, do not preface your rule with /.
Try:
http://myweb.com/ivan
http://myweb.com/restaurantes/something