hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : .htaccess
Reply

Forum Jump

.htaccess

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-01-2006, 05:04 PM
limagicman limagicman is offline
Newbie
 
Join Date: Jun 2005
Location: Commack, NY USA
Posts: 17

.htaccess


Hello all,
I was trying to redirect my main site (domain.com) to the subdomain secure (secure.domain.com). What is the best way to do that? I was thinking that an htaccess file would probably be the best way, but didnt know what code to use. Any help is appreciated.

Zach

__________________
Zach



Sponsored Links
  #2  
Old 08-01-2006, 05:10 PM
ThatScriptGuy ThatScriptGuy is offline
Web Hosting Master
 
Join Date: Feb 2003
Location: AR
Posts: 2,377
Code:
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^ http://secure.domain.com [R,L]
Kevin

__________________
Kevin Cackler
Tech Daddies - A Russellville, Arkansas based development company.
501-205-1512

  #3  
Old 08-01-2006, 05:19 PM
limagicman limagicman is offline
Newbie
 
Join Date: Jun 2005
Location: Commack, NY USA
Posts: 17
Quote:
Originally Posted by kvnband
Code:
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^ http://secure.domain.com [R,L]
Kevin
Kevin thanks for that code.

I just tried that and i am having problems getting the domain.com to redirect. It will direct domain.com/f or any file, but not that first file.

Zach

__________________
Zach

Sponsored Links
  #4  
Old 08-01-2006, 05:46 PM
limagicman limagicman is offline
Newbie
 
Join Date: Jun 2005
Location: Commack, NY USA
Posts: 17
The code that kevin posted does work. My major problem is that by browser cached that old site and once i cleared that i saw the redirect

__________________
Zach

  #5  
Old 08-01-2006, 05:49 PM
ThatScriptGuy ThatScriptGuy is offline
Web Hosting Master
 
Join Date: Feb 2003
Location: AR
Posts: 2,377
Glad it worked for you.......

__________________
Kevin Cackler
Tech Daddies - A Russellville, Arkansas based development company.
501-205-1512

Reply

Related posts from TheWhir.com
Title Type Date Posted
Mistakes To Avoid When Launching A New Website Design Blog 2014-01-10 10:53:50


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?