Real Estate Forums

Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here.

Reply
 
Thread Tools Display Modes
Old 02-09-2005, 04:37 PM
ResaleBroker's Avatar
ResaleBroker ResaleBroker is offline
Real Estate Webmaster
 
Join Date: Jun 2004
Posts: 4,727
ResaleBroker is on a distinguished road
Default Apache Mod_rewrite: Non-WWW to WWW

If you are on an Apache Server you can redirect the Non-WWW version of your site to the WWW version with this code in your .htaccess file:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC]
RewriteRule ^(.*)  http://www.yourdomain.com/$1 [L,R=301]
Reply With Quote
Old 02-09-2005, 04:59 PM
kyle422's Avatar
kyle422 kyle422 is offline
Real Estate Webmaster
 
Join Date: Oct 2004
Location: Florida
Posts: 2,109
kyle422 is on a distinguished road
Default Re: Apache Mod_rewrite: Non-WWW to WWW

Thanks Jeffery. I thought I had mine set up right and low and behold it wasn't working properly anymore.
Do you have one that can redirect "www.mysite.com/index.htm" to "www.mysite.com/"?
Reply With Quote
Old 02-09-2005, 05:02 PM
ResaleBroker's Avatar
ResaleBroker ResaleBroker is offline
Real Estate Webmaster
 
Join Date: Jun 2004
Posts: 4,727
ResaleBroker is on a distinguished road
Default Re: Apache Mod_rewrite: Non-WWW to WWW

Quote:
Originally Posted by kyle422
Do you have one that can redirect "www.mysite.com/index.htm" to "www.mysite.com/"?
Code:
RewriteRule ^index.htm$  http://www.mysite.com [L,R=301]
Reply With Quote
Old 02-09-2005, 05:07 PM
kyle422's Avatar
kyle422 kyle422 is offline
Real Estate Webmaster
 
Join Date: Oct 2004
Location: Florida
Posts: 2,109
kyle422 is on a distinguished road
Default Re: Apache Mod_rewrite: Non-WWW to WWW

doesn't seem to work??

Last edited by kyle422 : 02-10-2005 at 07:07 AM.
Reply With Quote
Old 02-09-2005, 05:23 PM
ResaleBroker's Avatar
ResaleBroker ResaleBroker is offline
Real Estate Webmaster
 
Join Date: Jun 2004
Posts: 4,727
ResaleBroker is on a distinguished road
Default Re: Apache Mod_rewrite: Non-WWW to WWW

That is a working mod_rewrite. Can you PM the contents of your .htaccess file?
Reply With Quote
Old 02-09-2005, 05:50 PM
kyle422's Avatar
kyle422 kyle422 is offline
Real Estate Webmaster
 
Join Date: Oct 2004
Location: Florida
Posts: 2,109
kyle422 is on a distinguished road
Default Re: Apache Mod_rewrite: Non-WWW to WWW

on the way.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

For our members

Main Sections

IDX Coverage Areas

Spiders Welcome

All times are GMT -7. The time now is 02:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.