Welcome Guest, Not a member yet? Register   Sign In
Simple? .htaccess wildcard subdomain rewrite
#3

[eluser]Timothy_[/eluser]
Hello,

Thanks for replying. I had a look at your htaccess rules and even tried the first one, but unless I am very much mistaken these look like rules to simply remove or keep www. Although nice to know, my question really wasn't asking for this. Please correct me or read my original post again.

I have managed to find and edit the following htaccess which almost works.
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-]+)\.domain\.com$ [NC]
RewriteRule !^([a-z0-9-]+)($|/) /%2%{REQUEST_URI} [PT,L]

Now when visiting http://application.domain.com it is actually rewriting the content from http://domain.com/application

Perfect... until you try and visit any other file or folder in the website.

htaccess doesn't rewrite every url so we end up with http://application.domain.com/applicatio...r/function

All help would be appreciated.

Thanks,

Tim


Messages In This Thread
Simple? .htaccess wildcard subdomain rewrite - by El Forum - 11-16-2010, 05:32 PM
Simple? .htaccess wildcard subdomain rewrite - by El Forum - 11-16-2010, 09:31 PM
Simple? .htaccess wildcard subdomain rewrite - by El Forum - 11-17-2010, 05:10 AM
Simple? .htaccess wildcard subdomain rewrite - by El Forum - 11-17-2010, 05:27 AM
Simple? .htaccess wildcard subdomain rewrite - by El Forum - 11-17-2010, 04:15 PM
Simple? .htaccess wildcard subdomain rewrite - by El Forum - 11-17-2010, 09:08 PM
Simple? .htaccess wildcard subdomain rewrite - by El Forum - 11-17-2010, 10:44 PM
Simple? .htaccess wildcard subdomain rewrite - by El Forum - 11-18-2010, 08:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB