I am trying to do some URL rewriting with htaccess but struggling a bit. Basically I am trying to use the following URL:
http://www.example.com/[pagename]
and display the contents of the file which sits at:
http://www.example.com/site/[pagename].php
I have searched online but can't find something that works.
My htaccess file looks like this:
Redirect 301 /page http://www.example.com
Redirect 301 /privacy http://www.example.com/site/privacy.php
Redirect 301 /EULA http://www.example.com/site/EULA.php
Redirect 301 /etiquette http://www.example.com/site/etiquette.php
ErrorDocument 404 /site/404.php
# Rewrite non-www to www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
The redirects at the top won't be needed once I figure out my problem.
Any help?
RewriteRule ^(.*)$ http://www.example.com/site/$1\.php [R=301,L]? - Shashank Kadne