User Name Password Register
DaniWeb IT Discussion Community
All
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 375,193 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 2,172 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:
Views: 501 | Replies: 0
Reply
Join Date: Jun 2007
Posts: 17
Reputation: ghostsquad is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
ghostsquad ghostsquad is offline Offline
Newbie Poster

Question .htaccess www rewrite for local and live site

  #1  
Dec 14th, 2007
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?

RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^/?$ http://www.mydomain.com [R=301]
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Site Layout and Usability Marketplace
Thread Tools Display Modes

Other Threads in the Site Layout and Usability Forum

All times are GMT -4. The time now is 2:10 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC