Solved

modrewrite question on subdomains

Posted on 2014-11-19
2
82 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
2 Comments
 
LVL 61

Expert Comment

by:gheist
Comment Utility
RewriteCondition ?
0
 
LVL 50

Accepted Solution

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

Open in new window

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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 …
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.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now