Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    356
    Thanks
    0
    Thanked 16 Times in 16 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder
    Join Date
    Oct 2004
    Posts
    356
    Thanks
    0
    Thanked 16 Times in 16 Posts
    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 /

  • #5
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you are the best!
    You solved a problem that even my isp did not know how.

    thanks allot
    Aaron


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •