You are not logged in.

#1 2010-10-11 04:29:40

nfm
Member
Registered: 2008-06-13
Posts: 66

Apache Subfolders

Hey guys,

I really have a hard time running multiple subfolders, and having the main address to my website at domain.com. Since I have multiple folders, I moved my drupal into ./drupal, I also have cgit web repository at ./cgit. I carefully studied this page and tried to setup a .htaccess in my root: http://drupal.org/node/135206. To access my website I now need to type domain.com/drupal, I would like it be just domain.com. I tried this:

RewriteEngine on
#
# stuff to let through (ignore)
RewriteCond %{REQUEST_URI} "/cgit/"
RewriteRule (.*) drupal/$1 [L]

However now domain.com/cgit is not accessible. How can I fix this?

Offline

#2 2010-10-11 07:48:49

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Apache Subfolders

If I understand you correctly, you want to redirect anything EXCEPT cgit/, dirA/, dirB/, dirC/ etc to /drupal/?

You need to negate the RewriteCond so it doesn't apply to the RewriteRule.

RewriteEngine on
#
# stuff to let through (ignore)
RewriteCond %{REQUEST_URI} !^/cgit/
RewriteCond %{REQUEST_URI} !^/dirA/
RewriteCond %{REQUEST_URI} !^/dirB/
RewriteCond %{REQUEST_URI} !^/dirC/
RewriteRule ^(.*)$ /drupal/$1 [last, redirect=permanent]

Offline

#3 2010-10-12 00:47:08

nfm
Member
Registered: 2008-06-13
Posts: 66

Re: Apache Subfolders

Thank you very much fukawi2! Looks like that's what I need. I have moved drupal back to ./ and left cgit in ./cgit. But now since you posted this it might do the trick smile.

Offline

Board footer

Powered by FluxBB