Irish SEO,  Marketing & Webmaster Discussion

 
Make money - save the planet!

no-www htaccess issue

This is a discussion on no-www htaccess issue within the Coding Help forums, part of the Webmaster Help category; I wanted to get rid of the www on my site as per no-www.org so I implemented the code in ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 15-03-2007, 04:34 AM
Coder
 
Join Date: Jan 2006
Posts: 43
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
frankp will become famous soon enough
Default no-www htaccess issue

I wanted to get rid of the www on my site as per no-www.org so I implemented the code in the htaccess file as they advocate...

Quote:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
However I ran into a problem - if someone tries to go to www.domain.com/somepage.htm for example they get sent to domain.com rather than domain.com/somepage.htm

I can't show an example right now as I removed the edit to my htaccess file!

Any ideas? Thanks for any help!



Last edited by frankp; 15-03-2007 at 04:38 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 15-03-2007, 10:07 AM
Cormac's Avatar
Cormac Moylan
 
Join Date: Jan 2006
Location: Baile Ath Cliath / Corcaigh
Posts: 1,251
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Cormac has much to be proud ofCormac has much to be proud ofCormac has much to be proud ofCormac has much to be proud ofCormac has much to be proud ofCormac has much to be proud ofCormac has much to be proud ofCormac has much to be proud ofCormac has much to be proud of
Send a message via AIM to Cormac Send a message via MSN to Cormac Send a message via Yahoo to Cormac Send a message via Skype™ to Cormac
Default

Quote:
Originally Posted by frankp View Post

I can't show an example right now as I removed the edit to my htaccess file!

Can you provide us with the exact code in the .htaccess file?
__________________
blog | Geansaí Gorm - Written entirely in, awful, Irish! | Me on Blue Jumpers
*
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 15-03-2007, 01:49 PM
Coder
 
Join Date: Jan 2006
Posts: 43
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
frankp will become famous soon enough
Default

Sure - and now that I look at it I'm guessing there's a conflict with the Wordpress stuff.. but I've no idea how one would sort it out... any/all help gratefully accepted!


Quote:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.bifsniff\.com$ [NC]
RewriteRule ^(.*)$ http://bifsniff.com/$1 [R=301,L]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 15-03-2007, 11:49 PM
blacknight's Avatar
Web Slave
Recent Blog:
 
Join Date: Jan 2006
Location: Ireland
Posts: 6,578
blacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to beholdblacknight is a splendid one to behold
Send a message via ICQ to blacknight Send a message via AIM to blacknight Send a message via MSN to blacknight
Default

It *might* help if you put all the rules into one block.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 16-03-2007, 01:16 AM
Coder
 
Join Date: Jan 2006
Posts: 43
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
frankp will become famous soon enough
Default Thanks!

thank you - you're spot on.

and to make matters worse - if I had added wordpress to my search I would have found this thread...

The no-ww code has to come BEFORE the lines:
Quote:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
it seems.

Currently working htaccess:

Quote:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.bifsniff\.com$ [NC]
RewriteRule ^(.*)$ http://bifsniff.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
htaccess, issue, nowww

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
CSS issue ph3n0m Coding Help 11 31-01-2007 12:05 AM
CSS Issue for Wordpress Menu.. Cormac Coding Help 4 03-12-2006 03:12 PM
No www. Cormac Webmaster Discussion 5 20-10-2006 02:33 PM
WP: WYSIWYG url issue Cormac Blogs & Blogging 4 01-09-2006 09:46 AM
Domain Transfer Issue fieldcorbett Domains and domaining 1 03-04-2006 06:55 PM


Sponsored links

Paid On Results


All times are GMT +1. The time now is 08:51 PM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0