I have the following code in my htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.*)$ /index.php?title=$1 [PT,L,QSA]
RewriteRule ^wiki/*$ /index.php [L,QSA]
RewriteRule ^wiki$ /index.php [L,QSA]
This shorten the URL from http://example.com/w/index.php?title=Page_title
to example.com/wiki/Page_title
.
I would also like to redirect example.com
to www.example.com
, but I am not sure on how I should implement this into the existing htaccess code without conflicting with other rules.
How can this be done?
RIght under
RewriteBase /
, add: