Forum Moderators: phranque
I have looked at this post, but am confused as hell.
[webmasterworld.com...]
What I want to do is redirect http://www.example.net/cms to http://www.example.net/ using .htaccess without having the cms at the end. I have tried using a redirect form, but that only forwards it to that sub folder. I just want the sub folder in the root directory to be the main site's URL. I want the cms part gone when I go to http://www.example.net/ and have it go to the folder that I created "cms" in the root directory.
I have tried DirectoryIndex /cms/index.php which works the way I want it, but I tend to have problems when trying to go to other parts of the website. Meaning it redirects me to the main site and not to another folder, unless I type out the filename directly. Then it takes me straight there. Is their an easier way to figure this out?
Also will any command affect search engine crawling or other unknown things?
Please any help ASAP would be much appreciated!
[edited by: encyclo at 11:13 am (utc) on Dec. 10, 2007]
[edit reason] switched to example.com [/edit]
RewriteEngine On
Options +FollowSymLinks
RewriteBase /
# The following two lines will make sure files
# which are existing in the root are not rewritten,
# so if you have any files in your root, they will take
# precedence.
RewriteCond cms/%{SCRIPT_FILENAME}
!-f
RewriteCond cms/%{SCRIPT_FILENAME}
!-d
RewriteRule ^(.*)$ cms/$1 [L]
Besides of this, why not just copy the content of the cms directory into your root?