Answer the question
In order to leave comments, you need to log in
How to use htaccess to make /post-name instead of /article.php?title=post-name?
Tell me, how can I make /post-name (or /article/post-name) through htaccess instead of /article.php?title=post-name ?
Answer the question
In order to leave comments, you need to log in
/article.php?title=post-name => /post-name
RewriteCond %{QUERY_STRING} (?:^|&)title\=post\-name(?:$|&)
RewriteRule ^article\.php$ /post\-name? [L,R=301]
RewriteCond %{QUERY_STRING} (?:^|&)title\=post\-name(?:$|&)
RewriteRule ^article\.php$ /article/post\-name? [L,R=301]
RewriteCond %{QUERY_STRING} (?:^|&)title\=(.+)(?:$|&)
RewriteRule ^article\.php$ /article/%1? [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question