...

htaccess rewrite

SilverApe
10-20-2005, 02:10 PM
hi all,

I have a version 1 of my site and there will be version 2 and more.
So I used the htacces file to automaticaly go from "mydomain.com" to "mydomain.com/cgx/v1". This works great, now if I want to go to v2 I only have to change it in the htacces file.
The problem is that I also have testing sites and a website for the people I work with (just 2 :).
These sites go like this: mydomain.com/files/intranet or something else.
But when I type that in my browser it goes to mydomain.com/cgx/v1/files/intranet.

How can I solve this so that it ignores the mydomain.com/cgx/v1 redirect?

this is what I have so far:

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

many thanks for any help :thumbsup:
Aaron

schleppel
10-20-2005, 04:26 PM
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} mydomain.com
RewriteCond %{REQUEST_URI} !cgx/v1/

# You can do this as many times as you want. Just don't put a / at the start of the uri (after the !^)
RewriteCond %{REQUEST_URI} !^files/interant/
RewriteCond %{REQUEST_URI} !^some_other_path/

RewriteRule ^(.*)$ cgx/v1/$1 [L]

SilverApe
10-20-2005, 04:45 PM
thanks for your quick reply.

sadly it does not work, it stil sends met to /cgx/v1/files/intranet .

so this is how it looks now:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} mydomain.com
RewriteCond %{REQUEST_URI} !cgx/v1/

RewriteCond %{REQUEST_URI} !^files/intranet/

RewriteRule ^(.*)$ cgx/v1/$1 [L]

any idea what I did wrong?

thanks
Aaron

schleppel
10-20-2005, 05:00 PM
Options +FollowSymlinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} mydomain.com

RewriteCond %{REQUEST_URI} !^/cgx/v1/?
RewriteCond %{REQUEST_URI} !^/files/intranet/?
RewriteCond %{REQUEST_URI} !^/some/other/path/?

RewriteRule ^(.*)$ cgx/v1/$1 [L]

Sorry, i hadn't tested it, and made a few mistakes. You actually do need a / after the !^ and you also need a ? after the last /

SilverApe
10-20-2005, 05:09 PM
you are the best!
You solved a problem that even my isp did not know how.

thanks allot
Aaron



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum