hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Hosting : redirecting contents of a subdomain to antoher url
Reply

Forum Jump

redirecting contents of a subdomain to antoher url

Reply Post New Thread In Web Hosting Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
Web Hosting Master
 
Join Date: Dec 2002
Location: UK
Posts: 836

redirecting contents of a subdomain to antoher url


Hi Guys

Can anyone tell me how to redirect a subdomain and all the contents into it to another URL

for example say i have the following website

something.mywebsite.com

now every single file within that subdomain how do i do it so that it redirects to another location?

So say i had a file called

http://something.subdomain.com/afold.../somefile.html

each time someone tries to access that somefile.html it gets directed to another URL

likewise the same thing with files in the root aswell
in other words what im saying the entire contents in public_html folder each time soemoen tries to acces a file within it it gets redirected be it images or html



Sponsored Links
  #2  
Old
Disabled
 
Join Date: Aug 2005
Posts: 35
for a subdomain, your control panel should have some sort of "redirection" feature, were you can force a client who visits the subdomain, to be redirected to another URL, for root public_html you should place an .htaccess file in there, thats if you have apache :-P

  #3  
Old
Web Hosting Master
 
Join Date: Dec 2002
Location: UK
Posts: 836
Yup i got Apache running

what do i put in that .htacess file for root?

cheers!

Sponsored Links
  #4  
Old
Web Hosting Master
 
Join Date: Dec 2001
Location: NYC
Posts: 1,902
You want mod_rewrite.

  #5  
Old
Web Hosting Master
 
Join Date: Dec 2002
Location: UK
Posts: 836
Hi thanks for your reply

I had a look and found this:


http://www.widexl.com/scripts/docume...d_rewrite.html

and there is code somewhere on that page which shows:

---------------------
Redirect visitor by domain name

DESCRIPTION: In some cases the same web site is accessible by different addresses, like domain.com, www.domain.com, www.domain2.com and we want to redirect it to one address.

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

EXPLAIN: In this case the requested URL http://domain.com/foo.html would redirected to the URL http://www.domain.com/foo.html.

----------------

is that the kinda thing i want? If so do i create a blank .htaccess file and post that code on? and if so where do i save it under? Public_html?

any help wud be appreicated

Thanks!

Reply

Related posts from TheWhir.com
Title Type Date Posted
Hacker Steals $83K in Bitcoins by Hijacking Traffic Directed at Large Hosting Companies Web Hosting News 2014-08-15 15:38:55
Linux Malware Operation Windigo Infects 25,000 Web Servers Web Hosting News 2014-03-19 11:44:53
Mistakes To Avoid When Launching A New Website Design Blog 2014-01-10 10:53:50
Facebook Class Action Seeks Damages for the Alleged Interception of Private Messages Web Hosting News 2014-01-07 10:10:05
Facebook's Recently Acquired Mobile App Platform Parse Launches Web Hosting for Developers Web Hosting News 2013-05-08 10:49:17


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:
WHT Membership
WHT Membership



 

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?