Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online Now
2 registered members (Zarzal, Gizmo), 76 guests, and 199 spiders.
Key: Admin, Global Mod, Mod
Member Spotlight
Mors
Mors
So. California
Posts: 472
Joined: June 2006
Show All Member Profiles 
Top Posters(30 Days)
Gizmo 17
isaac 10
SteveS 8
Morgan 5
Ruben 4
jorb 4
Zarzal 2
JPG 1
Latest Photos
Test
Testing to drag photos
Comfortable Cats
Test
BSA photos
Previous Thread
Next Thread
Print Thread
How do I force all "non-WWW" url requests to my "www" domain? #188515
06/24/07 02:14 AM
06/24/07 02:14 AM
Gizmo  Online Tapedshut OP
UBB.threads Developer
Joined: Jun 2006
Posts: 17,012
Portland, OR; USA
This is quite simple to do in Apache with your .htaccess file (if you don't have a .htaccess file in your web root, you can add one).

The following is what I use on my site to accomplish this:
Code
# Allow Re-Writing
RewriteEngine on

# Redirect non-www URLs to WWW
RewriteCond %{HTTP_HOST} ^corthell.net$
RewriteRule ^(.*) http://www.corthell.net/$1 [QSA,L,R=301]


Simply replace "corthell.net" with your domain on the two lines that it's mentioned, insert into your .htaccess file, and upload to your server.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
Re: How do I force all "non-WWW" url requests to my "www" domain? [Re: Gizmo] #194057
08/07/07 07:38 PM
08/07/07 07:38 PM
Gizmo  Online Tapedshut OP
UBB.threads Developer
Joined: Jun 2006
Posts: 17,012
Portland, OR; USA
Due to the non-www stance some users use, I'm also going to describe how to send all www requests to the non-www domain... Be sure that you're not using both of these as you could cause a lot of looping on your webserver.

The instructions above are still valid, however, use this .htaccess block.

Code
# Allow Re-Writing
RewriteEngine on

# Redirect WWW URLs to non-www
RewriteCond %{HTTP_HOST} ^www.corthell.net$
RewriteRule ^(.*) http://corthell.net/$1 [QSA,L,R=301]

Last edited by Gizmo; 08/03/11 01:35 AM.

I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Shout Box
Today's Birthdays
No Birthdays
Recent Topics
header.php after update from 7.5.x to 7.6.x
by Zarzal. 12/12/18 05:29 AM
Does 7.6.2 support php 71?
by Baldeagle. 12/12/18 02:17 AM
Cannot contact support
by . 12/11/18 06:43 PM
errors importing a database
by andrewjs18. 12/11/18 03:51 AM
Private Message, Opt out of conversation
by jorb. 12/04/18 10:11 PM
Forum Statistics
Forums36
Topics35,176
Posts191,656
Members12,121
Most Online978
Jun 24th, 2007
Random Image
Powered by UBB.threads™ PHP Forum Software 7.6.2