.htaccess tutorial

htaccess Elite


Help me hide a folder..

Ask your mod_rewrite and Redirection questions here, and get answers!

Help me hide a folder..

Postby jauntyMellifluous » 18 Aug 2008 21:21

Hi,

I've set up a site of mine here, http://www.roadsout.com. I've set it up so that the main folder for the site is 'roadsout' which is a subfolder in the root folder.

I'm using this .htaccess to make this happen.

Code: Select all
RewriteEngine on


Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} roadsout.com
RewriteCond %{REQUEST_URI} !roadsout/
RewriteRule ^(.*)$ roadsout/$1 [L]


RewriteCond %{HTTP_REFERER} !^http://www.roadsout.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.roadsout.com$      [NC]
RewriteRule .*\.(.*.*.*jpg|jpeg|gif|png|bmp)$ http://www.roadsout.com [R,NC]

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/roadsout.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]




It works, but when I click on some links on my site, it starts showing the subfolder inside my site too, for example,

http://www.roadsout.com/roadsout/index. ... e&Itemid=1

Can you give me some .htaccess code that will permanently hide that folder from showing up in my site's links?

Why do I want to make a subfolder and run it like that? Because it makes it easier for me to manage my folders and doesn't make a mess of things. Plus I want to host other sites too, so each site will have it's own folder which will be easy to manage.
jauntyMellifluous
 
Posts: 1
Joined: 18 Aug 2008 21:17

Return to Redirect or Rewrite Questions