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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    221
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question .htaccess not matching wildcard subdomains

    my .htaccess is, (like every n00b's) acting up on me...

    I have wildcard subdomains turned on and pointing to the document root...

    i have an index.php to catch errors, and a parse.php to catch successes, as a test.

    if I enter mysite.org/not_a_folder, i get to parse.php, however, if i enter not_a_folder.mysite.org, i see index.php instead.

    this implies an error with my first set of conditionals that I cannot find... the regex is my own, so that might be the issue, but it could just as well be me.

    Code:
    # BEGIN REWRITE
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !www.mysite.org$ [NC]
    RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-_.]+).mysite.org [NC]
    RewriteRule ^(.*)$ /parser.php  [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /parser.php  [L]
    
    </IfModule>
    any help would definitely be appreciated

  • #2
    Regular Coder
    Join Date
    Jan 2005
    Posts
    221
    Thanks
    2
    Thanked 0 Times in 0 Posts
    realized that i really don't need to store the subdomain, just test that there is one, but it appears to still not work

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !www\.mysite\.org$ [NC]
    RewriteCond %{HTTP_HOST} !^mysite\.org$ [NC]
    RewriteRule ^(.*)$ /parser.php  [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /parser.php  [L]
    
    </IfModule>


  •  

    Posting Permissions

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