.HTACCESS PROBLEMS. It won't redirect to my subdomain...HELP!

Discussion in 'Apache' started by tracks, Apr 20, 2008.

  1. #1
    SOME PLEASE HELP!

    I have a PhpFox script where short urls are enabled. The purpose of short urls is to take a long complicated url and automatically turn it into something like yoursite.com/name.

    Well, I also have a subdomain on this website, so this isn't going to fly. Everytime I try to go to gee.yoursite.com, it is automatically forwarded to www.yoursite.com/gee, which is causing the page not to show. Does anyone know how I can make it stay at gee.yoursite.com?

    Here is my .htaccess file

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteCond %{REQUEST_URI} !^/file/.*
    RewriteCond %{REQUEST_URI} !^/design/.*
    RewriteCond %{REQUEST_URI} !^/plugins/.*
    RewriteCond %{REQUEST_URI} !^/install/.*
    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteCond %{REQUEST_URI} !^/forum/.*
    RewriteCond %{REQUEST_URI} !^/gee/.*
    RewriteCond %{REQUEST_URI} !^/images/.*
    RewriteCond %{REQUEST_URI} !^/secrets/.*
    
    RewriteCond %{REQUEST_URI} !^/file/.*
    RewriteCond %{REQUEST_URI} !^/design/.*
    RewriteCond %{REQUEST_URI} !^/plugins/.*
    RewriteCond %{REQUEST_URI} !^/install/.*
    RewriteRule ^(.*)$ /index.php?do=/$1 [L]
    RewriteRule .*\.(/.*.*)$ /index.php?do=$1/index.php?do=/$1 [R,NC]
    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteCond %{REQUEST_URI} !^/forum/.*
    RewriteCond %{REQUEST_URI} !^/gee/.*
    RewriteCond %{REQUEST_URI} !^/images/.*
    RewriteCond %{REQUEST_URI} !^/secrets/.*
    
    Code (markup):
     
    tracks, Apr 20, 2008 IP
  2. jkwiz

    jkwiz Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    For one thing these are not being applied to your redirect statement because they are after it:

    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteCond %{REQUEST_URI} !^/forum/.*
    RewriteCond %{REQUEST_URI} !^/gee/.*
    RewriteCond %{REQUEST_URI} !^/images/.*
    RewriteCond %{REQUEST_URI} !^/secrets/.*
    Code (markup):
    To make your subdomain not get forwarded you want to add something like:

    RewriteCond %{HTTP_HOST} !^gee\.yoursite\.com
    Code (markup):
    Add the code towards the top after:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    Code (markup):
     
    jkwiz, Apr 21, 2008 IP