•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Site Layout and Usability section within the Web Development category of DaniWeb, a massive community of 422,811 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,356 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Site Layout and Usability advertiser: Programming Forums
Views: 669 | Replies: 0
![]() |
| |
•
•
Join Date: Jun 2007
Posts: 17
Reputation:
Rep Power: 2
Solved Threads: 1
I currently have some code in my .htaccess to redirect the user to the www version of the website.
IE if typed "mydomain.com" redirects to "www.mydomain.com"
But I also have apache installed on my development machine, setup with virtual hosts and my windows host file modified accordingly so I can go to mydomain.DEV and get to my local version
I want (without needing to modify the .htaccess file everytime I want to view my local version) to have that www rewrite apply for both the .dev and .com versions, anyone know how?
IE if typed "mydomain.com" redirects to "www.mydomain.com"
But I also have apache installed on my development machine, setup with virtual hosts and my windows host file modified accordingly so I can go to mydomain.DEV and get to my local version
I want (without needing to modify the .htaccess file everytime I want to view my local version) to have that www rewrite apply for both the .dev and .com versions, anyone know how?
RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^/?$ http://www.mydomain.com [R=301]![]() |
•
•
•
•
•
•
•
•
DaniWeb Site Layout and Usability Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: Building an Online Community
- Next Thread: Menu Layout Issue


Hybrid Mode