I just developed a new site for a client. It's all in a folder called /cms/. Is there a way to use mod rewrite to get rid of the cms folder in the URL? And at the same time make sure anyone going to the top-level of the domain (mydomain.com) sees the home page located at mydomain.com/cms/?
Also, I just want the /cms/ directory to be hidden. There are other directories like mydomain.com/pma/ that I still need to be able to access.
I've tried several suggestions, even some found on these forums, but nothing seems to be working. I admittedly, don't really understand .htaccess syntax yet, so I'm shooting in the dark as they say.
I've pieced together this chunk of code, which partially works (seems to display content from mydomain.com/cms/index.php, when someone goes to mydomain.com, but doesn't re-write anything if someone goes to mydomain.com/cms/index.php, or mydomain.com/cms/some-other-page.php (like when they click on a dynamic site link):
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
## hide index from home
RewriteRule ^cms/index\.(htm|html|php) http://mydomain.com/ [R=301,L]
## remove www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
## rewrite home page to not use /cms/
RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$
RewriteCond %{REQUEST_URI} !^/cms/
RewriteCond %{HTTP_HOST} !^/pma/
RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$
RewriteRule ^(/)?$ cms/index.php [L]
I'd also like to try and cut down on duplicate content by removing the index pages so I don't have /cms/ and /cms/index.php being different links.
any help would be greatly appreciated.
-Tristan