[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 110
  • 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

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

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