Answer the question
In order to leave comments, you need to log in
How to change the appearance of links through .htaccess?
Good afternoon! Google did not help solve the issue. There is a .htaccess file like this:
RewriteEngine On
RewriteRule ^index\.php$ / [R=301,L]
RewriteRule ^(.*)/index\.php$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [L]
RewriteRule ^category/([0-9]+) category.php?id=$1 [L]
ErrorDocument 404 /404.php Change
links like https://mysite.rf/category.php?id=1 to https://mysite.rf/category/1. But with such rules in .htaccess, by default the link remains as in the first option. The second option can only be obtained by entering the link into the address bar manually. Tried different options from Google, but nothing helped. Please tell me how to solve
Answer the question
In order to leave comments, you need to log in
mod_rewrite (which newbies mistakenly call .htaccess) does not change links . it can only automatically redirect to another when requesting a certain link. but it cannot change anything in the site code.
to change the links on the site, they must be... changed on the site!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question