CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Apache configuration (http://www.codingforums.com/forumdisplay.php?f=69)
-   -   htaccess Rewrite Specifically For Subdomains (http://www.codingforums.com/showthread.php?t=92197)

curb 07-28-2006 08:16 AM

htaccess Rewrite Specifically For Subdomains
 
I want to use rewrite code for my subdomain but my primary domain is affected by this. How do I just use the code that's made only for that subdomain?

Quote:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

rlemon 07-28-2006 03:07 PM

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(www.)?(*.)yourdomain.com$ index.php?q=$1 [L,QSA]

try that.

curb 07-28-2006 03:59 PM

It's giving me an internal server error. =/

schleppel 07-28-2006 04:05 PM

Try this:
Code:

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^(www\.)?DOMAIN$ [NC]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [QSA,L]

Replace DOMAIN with your domain (no www.). Escape any "."s with a "\", eg. "google.com" becomes "google\.com".

curb 07-28-2006 04:46 PM

Thanks schleppel. It is now working. :thumbsup:


All times are GMT +1. The time now is 01:17 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.