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 12-16-2011, 01:18 AM   PM User | #1
singedpiper
Regular Coder

 
Join Date: Jan 2005
Posts: 221
Thanks: 2
Thanked 0 Times in 0 Posts
singedpiper is an unknown quantity at this point
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
singedpiper is offline   Reply With Quote
Old 12-16-2011, 01:42 AM   PM User | #2
singedpiper
Regular Coder

 
Join Date: Jan 2005
Posts: 221
Thanks: 2
Thanked 0 Times in 0 Posts
singedpiper is an unknown quantity at this point
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>
singedpiper 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 12:47 PM.


Advertisement
Log in to turn off these ads.