Webmaster Forum


Go Back   Webmaster Forum > Web Development > Domain Name Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Domain Name Forum Discuss or get help with domain name issues. Ask for suggestions, etc.

Lionsanime Directory   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 01-09-2008, 04:44 AM   #1 (permalink)
Junior Member
 
Join Date: 01-09-08
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

projectwealth is liked by many
Exclamation Need help with .htaccess file (www. redirection)

Hello there,

I'm going completely insane with a new website of mine at the moment.

I'm hosting with hostgator.com and they use an apache server. The problem is when I type my website name into the browser http://www.richandjobless.com for some reason it redirects to http://richandjobless.com

For branding reasons I want to keep the www.

The default .htaccess file reads as follows:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


I've tried to edit the .htaccess file to redirect to www. by adding the following code:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^richandjobless.com
RewriteRule (.*) http://www.richandjobless.com/$1 [R=301,L]


but it redirects back to www. then the non-www address in an infinite loop so it doesn't help much at all.

Does any one have any ideas why this is happening and what I can do to fix it?

FYI... I don't know if this helps but the contents of the index.php file that the .htaccess file refers to is as follows:

<?php
/* Short and sweet */
define('WP_USE_THEMES', true);
require('./wp-blog-header.php');
?>

Any and all suggestions would be GREATLY appreciated.

Thanks very much,

Dave
projectwealth is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 01-09-2008, 04:46 AM   #2 (permalink)
Contributing Member
 
TechSup's Avatar
 
Join Date: 12-27-07
Location: North Carolina
Posts: 655
iTrader: 1 / 100%
TechSup is just really niceTechSup is just really niceTechSup is just really niceTechSup is just really niceTechSup is just really niceTechSup is just really niceTechSup is just really niceTechSup is just really niceTechSup is just really niceTechSup is just really nice
Add this to your .htaccess file

Code:
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]
Change the rules to your site to force a redirect.
__________________
Best Regards, TechSup
Google your question(s) before you ask.
TechSup is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-09-2008, 04:58 AM   #3 (permalink)
Junior Member
 
Join Date: 01-09-08
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

projectwealth is liked by many
Hi Steven,

That's for replying so quickly! Much appreciated.

I just tried that piece of code out but unfortunately I'm getting the same infinite redirect loop.

Any other ideas? It seems to be dead set on redirecting to the non-www address
projectwealth is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-09-2008, 06:11 AM   #4 (permalink)
v7n Mentor
 
Join Date: 07-24-06
Posts: 642
iTrader: 1 / 100%
Latest Blog:
None

nasty.web is just really nicenasty.web is just really nicenasty.web is just really nicenasty.web is just really nicenasty.web is just really nicenasty.web is just really nicenasty.web is just really nicenasty.web is just really nicenasty.web is just really nicenasty.web is just really nice
Code:
dig www.richandjobless.com. ;; ANSWER SECTION: www.richandjobless.com. 14400 IN CNAME richandjobless.com. richandjobless.com. 14387 IN A 74.53.26.226
You should change your DNS records. Setup your www domain to be A type record, not a CNAME alias.
nasty.web is online now  
Add Post to del.icio.us
Reply With Quote
Old 01-09-2008, 06:32 AM   #5 (permalink)
Junior Member
 
Join Date: 01-09-08
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

projectwealth is liked by many
Hi Nasty,

Thanks a lot for the suggestion. I've done that now. It said to allow up to 24 hours for the setting to take effect so I guess I'll just wait now

I'll be back to post the outcome tomorrow.

Thanks again,

Dave
projectwealth is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Domain Name Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with HTACCESS file brandnew Coding Forum 2 12-02-2007 11:13 PM
Please tell me how to make 301 redirection of these links in this .htaccess file? antispyware Coding Forum 1 07-10-2007 02:00 PM
Some help with .htaccess file and 301 Redirects Pairodime Coding Forum 7 04-12-2007 03:04 PM
.htaccess file handling eloquent Coding Forum 6 02-01-2007 02:07 AM
.htaccess redirection problem; URL without ending slash 404s Matthew Doucette Coding Forum 3 03-15-2006 04:41 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 01:22 PM.
© Copyright 2008 V7 Inc