Answer the question
In order to leave comments, you need to log in
Mod_rewrite Ubuntu?
There is a configured local server on a computer. LAMP. Everything works great, but there is a problem with mod_rewrit. There are lines in .htaccess:
RewriteEngine on
RewriteRule ^article/([0-9]+)/? article.php/?id=$1 [QSA,L]
But the page does not respond to localhost/article/1 , but only to localhost/article.php/?id=1
Everything works on the hosting.
"AllowOverride All" seems to be there.
How to fix?
Answer the question
In order to leave comments, you need to log in
You forgot to add RewriteBase. Without it, you are redirected to /home/USER/public_html/article.php and so on.
Do this:
RewriteEngine on
RewriteBase /
RewriteRule ^article/([0-9]+) article.php?id=$1 [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question