Solved

modrewrite question on subdomains

Posted on 2014-11-19
2
87 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
ID: 40454355
RewriteCondition ?
0
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP Healthcheck 2 83
php email 2 26
html input type 3 21
Why my select dropdown does not work? 8 21
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

919 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

14 Experts available now in Live!

Get 1:1 Help Now