Reply
htaccess to make www. go to non-www not work on directories :S
Old 09-07-2008, 04:57 PM htaccess to make www. go to non-www not work on directories :S
dansgalaxy's Avatar
Eat, Sleep, Code

Posts: 6,513
Name: Dan
Location: Swindon
Trades: 0
Hi

okay im using
Code:
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^www.xdnet.co.uk
RewriteRule (.*) http://xdnet.co.uk/$1 [R=301,L]
on my site to redirect all www.xdnet.... addresses to the non-www version.

this works for things like
www.xdnet.co.uk/shared.php -> xdnet.co.uk/shared.php

but if its a folder like

www.xdnet.co.uk/blog/ -> xdnet.co.uk

Why?!

TP for a working fix
Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
 
When You Register, These Ads Go Away!
Old 09-07-2008, 05:36 PM Re: htaccess to make www. go to non-www not work on directories :S
andrei155's Avatar
CEO of BLD Hosting

Latest Blog Post:
Cpanel Update
Posts: 1,340
Name: Andrei
Location: Canada
Trades: 6
www.xdnet.co.uk/images
works just fine.
__________________
No Overselling Guarantee
Now Includes a Free Domain
BLD Hosting - Web Hosting | Web Hosting Blog
andrei155 is offline
Reply With Quote
View Public Profile Visit andrei155's homepage!
 
Old 09-07-2008, 05:42 PM Re: htaccess to make www. go to non-www not work on directories :S
dansgalaxy's Avatar
Eat, Sleep, Code

Posts: 6,513
Name: Dan
Location: Swindon
Trades: 0
okay... so then obviously its something to do with wordpress... any ideas?

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 09-07-2008, 05:44 PM Re: htaccess to make www. go to non-www not work on directories :S
andrei155's Avatar
CEO of BLD Hosting

Latest Blog Post:
Cpanel Update
Posts: 1,340
Name: Andrei
Location: Canada
Trades: 6
Your wordpress directory (/blog) might have it's own .htaccess file. Try looking into that.
__________________
No Overselling Guarantee
Now Includes a Free Domain
BLD Hosting - Web Hosting | Web Hosting Blog
andrei155 is offline
Reply With Quote
View Public Profile Visit andrei155's homepage!
 
Old 09-07-2008, 05:48 PM Re: htaccess to make www. go to non-www not work on directories :S
dansgalaxy's Avatar
Eat, Sleep, Code

Posts: 6,513
Name: Dan
Location: Swindon
Trades: 0
yep, stupid me.. i copied the htaccess to blog/ and made it writeable when i set up the mod_rewrite... all good now

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 09-08-2009, 11:37 AM Re: htaccess to make www. go to non-www not work on directories :S
GeekSpecialties's Avatar
Super Talker

Posts: 113
Name: Leonard
Location: Minnesota, USA
Trades: 0
I need something very similar
non-www to www, with subdirectory support.

What I have redirects remodelcrazy.com to www.remodelcrazy.com
but not
remodelcrazy.com/forum to www.remodelcrazy.com/forum

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.remodelcrazy\.com$ [NC]
RewriteRule ^(.*)$ http://www.remodelcrazy.com/$1 [R=301,L]
There is an htaccess file in /forum but this is all it contains (rewrite for a sitemap plugin). It seems no matter what I put in there it does nothing.
Code:
RewriteEngine On
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

Last edited by chrishirst; 09-09-2009 at 05:15 AM.. Reason: live links broken
GeekSpecialties is offline
Reply With Quote
View Public Profile Visit GeekSpecialties's homepage!
 
Reply     « Reply to htaccess to make www. go to non-www not work on directories :S
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.12931 seconds with 13 queries