Htaccess redirect from subdomain not passing subdomain part?

Do something like that: If the subdomain isn't www then redirect to the login page RewriteCond "%{HTTP_HOST}"! ^www. * NC RewriteCond "%{HTTP_HOST}" ^(^\.

+). *$ RewriteRule ^(.*)$ https://secure.mydomain. Com/a/%1 R=301,L In general you have to catch the subdomain part and backreference it.

So I added a second RewriteCond that does just that. Backreferences in RewriteConds are accessed with '%n' patterns in RewriteRules.

Do something like that: # If the subdomain isn't www then redirect to the login page RewriteCond "%{HTTP_HOST}"! ^www. * NC RewriteCond "%{HTTP_HOST}" ^(^\.

+). *$ RewriteRule ^(.*)$ https://secure.mydomain. Com/a/%1 R=301,L In general you have to catch the subdomain part and backreference it.

So I added a second RewriteCond that does just that. Backreferences in RewriteConds are accessed with '%n' patterns in RewriteRules.

Top job. I knew I must've been missing something simple. – Ira Rainey Jun 2 '10 at 12:47.

Htaccess file which catches all subdomains (I am using a wildcard DNS record) and redirects them to a secure login page, but only if the subdomain isn't www. This is working in part. But the subdomain bit isn't being appended to the end.

I thought the %1 bit would do this but it seems to not be working. Anybody any thoughts?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions