Forum Moderators: phranque

Message Too Old, No Replies

Rewrite base url to subfolder

         

ironik

2:45 am on Jun 10, 2005 (gmt 0)

10+ Year Member



I've having a little trouble with mod rewrite. Basically what I have is a site located in a folder off the base www directory. I want my domain to re-direct all traffic to this folder transparently (not sure if there are any search engine penalities for this?). Something like:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /home/.myServer/myUserName/www.example.com/myFolder

What I also need is for it to ignore certain addresses. I have a forum installed in a folder at the same level as 'myFolder' and I want to be able to direct traffic to this, and other existing folders without being re-directed to http://www.example.com/myFolder/

Is there anyway to re-direct to the 'myFolder' folder if the address is just the plain domain name, or if the requested directory or file does not exist? If possible, I'd like to also put a .htaccess file in the 'myFolder' directory that will handle requests for search engine friendly urls (is that possible to have 2 or will it cause problems?)

I hope I've explained that properly...

Thanks in advance

jdMorgan

3:26 pm on Jun 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mod_rewrite can do all of the above. However, RewriteBase is not the directive you want to use. Rather, use RewriteRule to define the URLs you want to rewrite, and use RewriteCond to test server variables to qualify or create exceptions to the rewrite.

Our forum charter [webmasterworld.com] cites several useful documents to get you started.

Jim