Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 109
  • Last Modified:

modrewrite question on subdomains

I have this rewrite rule in my htaccess but I want to add some sub domains.

RewriteRule ^(.*)$ https://www.prizemagnet.com/$1 [R=301,L]

This does not work because it also rewrites the subdomains to the main domain.
How can I have the above and do the subdomains as well.
Thanks
0
Luey
Asked:
Luey
1 Solution
 
gheistCommented:
RewriteCondition ?
0
 
Steve BinkCommented:
Try this:
RewriteCond %{HTTP_HOST} ^(.+)\.prizemagnet\.com$ [NC]
RewriteRule ^/?(.*)$ https://%1.prizemagnet.com/$1 [NC,L]

Open in new window

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now