hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : mod_rewrite question
Reply

Forum Jump

mod_rewrite question

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 02-11-2004, 12:22 AM
nwingate nwingate is offline
Newbie
 
Join Date: Dec 2003
Posts: 14
Question

mod_rewrite question


I'm switching servers and changing names all at the same time.

I want to use a mod_rewrite to seemlessly transfer my visitors to the new site as well as help keep some of my PR and Links.

Anyways, I set up an .htaccess file as:
RewriteEngine On

RewriteRule ^(.*)$ http://www.newserver/$1 [R=301,L]


But there is a problem! My old server used a public folder of /HTML and my new server uses /public_html

Is there a conditional that I can throw into my .htaccess file to switch folders AND Redirect?

Thanks!



Sponsored Links
  #2  
Old 02-11-2004, 01:02 AM
kb9tyc kb9tyc is offline
Junior Guru
 
Join Date: Oct 2003
Posts: 200
What's wrong with a simple: redirect / http:newdomain.com in the .htaccess file?

The public folder really doesn't matter to your visitors. They can only see what's in the public_html folder.

  #3  
Old 02-11-2004, 11:17 AM
nwingate nwingate is offline
Newbie
 
Join Date: Dec 2003
Posts: 14
Redirects don't work for your whole site.

mod_rewrite allows you to redirect your whole site and also allows Spiders to follow links better.

Example: oldsite.com/forum/showthread.php?s=&threadid=235530 will automatically go to newsite.com/forum/showthread.php?s=&threadid=235530

Right?

Sponsored Links
  #4  
Old 02-11-2004, 12:37 PM
Website Rob Website Rob is offline
learning is in the doing
 
Join Date: Sep 2000
Location: Alberta, Canada
Posts: 3,109
kb9tyc, is giving some good advice. The only thing I would do different is:

Redirect Permanent / http://newdomain.com

Dont' know where you got the idea that Redirect does not work for a whole site? There is also the fact that a RewriteRule is backwards compatiable (URL doesn't change on the redirection) and SEs will not update their listings. With the Redirect they will.

__________________
PotentProducts.com - for all your Hosting needs
Helping people Host, Create and Maintain their Web Site
ServerAdmin Services also available

  #5  
Old 02-11-2004, 12:48 PM
nwingate nwingate is offline
Newbie
 
Join Date: Dec 2003
Posts: 14
Unless I've missunderstood here is the difference:

The redirect will forward the whole site but only to one page.
So - OldSite.com/forums/thread55 will be forwarded to NewSite.com

The mod_rewrite will forward individual pages to the new sites corresponding page.
So - OldSite.com/forums/thread55 will be forwarded to NewSite.com/forums/thread55

I got my info by the way from: http://www.tamingthebeast.net/articl...main-names.htm


If I'm not understanding this correctly please let me know.

Nathan

  #6  
Old 02-11-2004, 03:56 PM
kb9tyc kb9tyc is offline
Junior Guru
 
Join Date: Oct 2003
Posts: 200
The redirect should work with any page in the site. I have done this many times.

  #7  
Old 02-11-2004, 04:11 PM
nwingate nwingate is offline
Newbie
 
Join Date: Dec 2003
Posts: 14
OK, I'll test it out. I guess the info I got was wrong

Reply

Related posts from TheWhir.com
Title Type Date Posted
Emerging Tech: Email, Security and Privacy Blog 2013-08-29 11:29:43
UK Tech Blog Challenges CloudFlare, Web Hosts on Free Speech Blog 2013-08-12 10:32:52
The Value of Your Intellectual Property Blog 2013-05-06 17:43:13
Joomla Hosting Study Shows Speed, Uptime Top Selling Points of a Web Host Web Hosting News 2012-11-07 15:06:36
10-14-2012 Roswell, NM - The Hosting Shift Blog 2012-10-24 15:14:40


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?