Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

modrewrite question on subdomains

Posted on 2014-11-19
2
Medium Priority
?
104 Views
Last Modified: 2014-11-20
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
Comment
Question by:Luey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 40454355
RewriteCondition ?
0
 
LVL 51

Accepted Solution

by:
Steve Bink earned 2000 total points
ID: 40454476
Try this:
RewriteCond %{HTTP_HOST} ^(.+)\.prizemagnet\.com$ [NC]
RewriteRule ^/?(.*)$ https://%1.prizemagnet.com/$1 [NC,L]

Open in new window

0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question