tags:

views:

19

answers:

1

Im a complete beginner with Apache re-writes.

Im trying to get example.com/forum to be example.com/index.php?page=forum

Here is my rewrite file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^/forum$ index.php?page=forum

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>
A: 
RewriteRule ^(.*)$ index.php?page=$1

This should work for you.

ShiVik
Thank you but I only want to rewrite /forum not for example /foo-bar
nullptr
@nullptr - In that case, isn't your htaccess already working? All I can think up is adding the `[L]` flag to the end of `RewriteRule` you have written.
ShiVik
You could be right, the other rules are auto generated by wordpress so I have no idea what going on
nullptr
@nullptr - Try doing this `RewriteRule ^/forum$ index.php?page=forum [L]`. see if this works.
ShiVik