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 Coder
    Join Date
    May 2006
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

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

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Posts
    1,051
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 ---<

  • #3
    New Coder
    Join Date
    May 2006
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's giving me an internal server error. =/

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

  • #5
    New Coder
    Join Date
    May 2006
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks schleppel. It is now working.


  •  

    Posting Permissions

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