Mod_rewrite help

October 27, 2013 3.5k views
Hello, I need some help with my mod_rewrite. - Note, this is my first time trying to play with .htaccess I have some rewrite rules in it already, which works fine, looks like this: Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([\w\d~%.:_\-]+)$ index.php?page=$1 [QSA] So when I go to then it goes to what I need more is that, when they go to then it will go to I've tried with this line: RewriteRule ^news/([0-9]+) /news.php?id=$1 - but do not work. Any question is, would it be able to replace id number with the name of the post, like instead of it will be Thanks
4 Answers
Are you using WordPress? If not, you may want to consider it (given that it has a nice permalink module that automatically writes the Mod_rewrite rules for you.
No, I do not use WordPress, I prefer build my own :)
Have you set AllowOverride All on apache? /etc/apache2/sites-available/
Have another answer? Share your knowledge.