Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-20-2005, 02:10 PM   PM User | #1
SilverApe
New to the CF scene

 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
SilverApe is an unknown quantity at this point
Question htaccess rewrite

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:

Code:
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
Aaron
SilverApe is offline   Reply With Quote
Old 10-20-2005, 04:26 PM   PM User | #2
schleppel
Regular Coder

 
Join Date: Oct 2004
Posts: 330
Thanks: 0
Thanked 13 Times in 13 Posts
schleppel is an unknown quantity at this point
Code:
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]

Last edited by schleppel; 10-20-2005 at 04:30 PM..
schleppel is offline   Reply With Quote
Old 10-20-2005, 04:45 PM   PM User | #3
SilverApe
New to the CF scene

 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
SilverApe is an unknown quantity at this point
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
SilverApe is offline   Reply With Quote
Old 10-20-2005, 05:00 PM   PM User | #4
schleppel
Regular Coder

 
Join Date: Oct 2004
Posts: 330
Thanks: 0
Thanked 13 Times in 13 Posts
schleppel is an unknown quantity at this point
Code:
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 /
schleppel is offline   Reply With Quote
Old 10-20-2005, 05:09 PM   PM User | #5
SilverApe
New to the CF scene

 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
SilverApe is an unknown quantity at this point
you are the best!
You solved a problem that even my isp did not know how.

thanks allot
Aaron
SilverApe is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:53 AM.


Advertisement
Log in to turn off these ads.