Welcome to WebmasterWorld Guest from 50.16.112.199

Forum Moderators: Ocean10000 & incrediBILL & phranque

Exclude Subdomain from root htaccess Rewrite

   
7:11 pm on Sep 17, 2010 (gmt 0)

5+ Year Member



Hi,

I am running a script in my root that has the following htaccess code. It is interfering with Wordpress which is running in a subdomain on the same server. How can I limit this htaccess code so that it does not interfere with the operation of Wordpress. I did not write the code. It comes with the script. Thanks for the help!

Rich

RewriteRule \.(css|php|png|jpg|gif|ico|js|inc|txt|gz|xml|html)$ - [NC,L]
RewriteRule ^([^/]*)/?$ index.php?page=$1 [L]
RewriteRule ^([^/]*)/([^/]*)/?$ index.php?$1=$2 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/?$ index.php?page=$1&$2=$3 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ index.php?$1=$2&$3=$4 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ index.php?page=$1&$2=$3&$4=$5 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ index.php?$1=$2&$3=$4&$5=$6 [L]
11:49 pm on Sep 17, 2010 (gmt 0)

5+ Year Member



Are the subdomain and domain pointing to the same physical directory on your server?

Anyway, without knowing your server and sub-/domain configs, you could prevent any interferences by putting this line before each RewriteRule:

RewriteCond %{HTTP_HOST} !^sub\.example\.com$

which tells apaches mod_rewrite module not to follow the following rule if the domain host is your subdomain.
7:46 pm on Sep 18, 2010 (gmt 0)

5+ Year Member



Hi,

Thanks much. It worked.

Yes, the domain and subdomain are on the same server hosted on Hostgator.

Rich
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month