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 07-28-2006, 08:16 AM   PM User | #1
curb
New Coder

 
Join Date: May 2006
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
curb is an unknown quantity at this point
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]
curb is offline   Reply With Quote
Old 07-28-2006, 03:07 PM   PM User | #2
rlemon
Senior Coder

 
Join Date: Apr 2005
Posts: 1,051
Thanks: 0
Thanked 0 Times in 0 Posts
rlemon is on a distinguished road
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(www.)?(*.)yourdomain.com$ index.php?q=$1 [L,QSA]

try that.
__________________
public string ConjunctionJunction(string words, string phrases, string clauses)
{
return (String)(words + phrases + clauses);
}
<--- Was I Helpfull? Let me know ---<
rlemon is offline   Reply With Quote
Old 07-28-2006, 03:59 PM   PM User | #3
curb
New Coder

 
Join Date: May 2006
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
curb is an unknown quantity at this point
It's giving me an internal server error. =/
curb is offline   Reply With Quote
Old 07-28-2006, 04:05 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
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".
schleppel is offline   Reply With Quote
Old 07-28-2006, 04:46 PM   PM User | #5
curb
New Coder

 
Join Date: May 2006
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
curb is an unknown quantity at this point
Thanks schleppel. It is now working.
curb 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 01:31 PM.


Advertisement
Log in to turn off these ads.