.htaccess for wildcard DNS Help

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
DaveTheAve
Forum Contributor
Posts: 385
Joined: Tue Oct 03, 2006 2:25 pm
Location: 127.0.0.1
Contact:

.htaccess for wildcard DNS Help

Post by DaveTheAve »

Here is my current .htaccess:

Code: Select all

# Rewrite <subdomain>.example.com/<path> to example.com/<subdomain>/<path>
RewriteEngine On
# Skip rewrite if no hostname or if subdomain is www
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
# Extract (required) subdomain (%1), and first path element (%3), discard port number if present (%2)
RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ^([^.]+)\.information-now\.net(:80)?<>/([^/]*) [NC]
# Rewrite only when subdomain not equal to first path element (prevents mod_rewrite recursion)
RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
# Rewrite to /subdomain/path
RewriteRule ^(.*) /%1/$1 [L]
Can anyone see why that is failing to process requests? It's uploaded to /public_html/ and it's not helping any.

Edit: FYI: It's a 500 server error.
Post Reply