Old 08-02-2007, 15:07   #1 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
htaccess question

We want to redirect an entire old site to a single URL.

For example:

www.oldsite.com/*

to

www.newsite.com/something/blah.html

However, when I use

Code:
Redirect 301 / http://www.newsite.com/something/blah.html
It'll go to something like: www.oldsite.com/products.html -> http://www.newsite.com/something/blah.htmlproducts.html

How can I drop that "products.html" bit?
  Reply With Quote
Old 08-02-2007, 16:35   #2 (permalink)
roto
Floating libation anyone?
 
roto's Avatar
 
Join Date: Apr 2003
Location: El Barco del Amor
Posts: 4,633
Send a message via AIM to roto Send a message via Yahoo to roto
Try this:

Code:
RewriteEngine ON RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]

It should catch it all and redirect accordingly. However, your server has to be configured accordingly, so I'm not quite sure if this will help given your error above.

IMO, though, use that other bit above just for redirecting from an old page to a new one.
__________________
fun: HGC v.4 | last.fm: DT | me | oi! f*ck u roto: ...via meebo!

New to interweb design? Your friends at dt can help.
  Reply With Quote
Old 08-02-2007, 16:38   #3 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Gotcha. I'll try your crazy moon language...

EDIT: Awesome. It works. Thanks a mil.
  Reply With Quote
Old 08-02-2007, 16:54   #4 (permalink)
sjd
Registered Abuser
 
sjd's Avatar
 
Join Date: Jun 2006
Location: London, England.
Posts: 175
That rule will take whatever you have after the domain name and append it on the end of ht*p://www.newsite.com/. So if you have ht*p://www.theoldsite.com/one/two/three.html it'll redirect you to ht*p://www.thenewsite.com/one/two/three.html

To redirect from any page on the old site to a single page on the new site, use the following:

Code:
RewriteEngine ON RewriteRule ^(.*)$ http://www.thenewsite.com/something/blah.html [R=301,L]
  Reply With Quote
Old 08-02-2007, 16:55   #5 (permalink)
sjd
Registered Abuser
 
sjd's Avatar
 
Join Date: Jun 2006
Location: London, England.
Posts: 175
Timing!
  Reply With Quote
Old 08-02-2007, 21:33   #6 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Better luck next time, bud.
  Reply With Quote
Old 09-02-2007, 08:07   #7 (permalink)
roto
Floating libation anyone?
 
roto's Avatar
 
Join Date: Apr 2003
Location: El Barco del Amor
Posts: 4,633
Send a message via AIM to roto Send a message via Yahoo to roto
Quote:
Originally Posted by pgo
Gotcha. I'll try your crazy moon language...
Happy to help, m8. I'm glad it worked.
__________________
fun: HGC v.4 | last.fm: DT | me | oi! f*ck u roto: ...via meebo!

New to interweb design? Your friends at dt can help.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8