Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
htaccess to split the www and non-www
Old 05-15-2010, 08:29 AM htaccess to split the www and non-www
Junior Talker

Posts: 2
Name: Jack
Trades: 0
I am looking at trying to split up the www and non-www parts of my site.

Basically I have some of my own content on the site, which I still want to be accessible via domain.com
I also have a directory part of the site, which is hosted on directory.domain.com

Now I want it so if anyone tries to go to www.domain.com it will redirect them to directory.domain.com
In doing this, I also want to keep the non-www domain.com accessible which has my own bits on it.

I have tried some htaccess redirect rules and I can get it redirecting but it also tries to redirect the non-www domain.com as well, which I do not want.

Thanks for any help
logicaljack is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-15-2010, 08:33 AM Re: htaccess to split the www and non-www
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,390
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Not a htaccess problem.

remove all redirects from htaccess and use the hosting setup change it.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-16-2010, 07:26 PM Re: htaccess to split the www and non-www
GCM
GCM's Avatar
Average Talker

Posts: 21
Location: Michigan, United States
Trades: 0
Quote:
Originally Posted by logicaljack View Post
I am looking at trying to split up the www and non-www parts of my site.

Basically I have some of my own content on the site, which I still want to be accessible via domain.com
I also have a directory part of the site, which is hosted on directory.domain.com

Now I want it so if anyone tries to go to www.domain.com it will redirect them to directory.domain.com
In doing this, I also want to keep the non-www domain.com accessible which has my own bits on it.

I have tried some htaccess redirect rules and I can get it redirecting but it also tries to redirect the non-www domain.com as well, which I do not want.

Thanks for any help
Hello,

Please try this.

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.YOURDOMAIN.net [NC]
RewriteRule ^(.*)$ http://directory.YOURDOMAIN.com/$1 [L,R=301]
</IfModule>
__________________
Axigy - Shared and Dedicated Linux Web Hosting Solutions

Please login or register to view this content. Registration is FREE
GCM is offline
Reply With Quote
View Public Profile Visit GCM's homepage!
 
Old 07-06-2010, 05:01 AM Re: htaccess to split the www and non-www
Junior Talker

Posts: 2
Name: Jack
Trades: 0
Thanks guys, I got it in the end

Was a bit of help from both.
I had marked the setup to use both the www and non-www records, i removed this and things were a lot easier.

Have started to do some htaccess trickery though to get everything else sorted out

Cheers guys
__________________
Website -
Please login or register to view this content. Registration is FREE

Directory -
Please login or register to view this content. Registration is FREE

Last edited by logicaljack; 07-06-2010 at 05:02 AM..
logicaljack is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to htaccess to split the www and non-www
 

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.25393 seconds with 12 queries