Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Aug 14, 2012 2:06 pm 
Offline
Newbie

Joined: Tue Aug 14, 2012 2:01 pm
Posts: 2
Hello. This has been driving me crazy all weekend.

I am using Apache2 and am trying to get a 301 Redirect of eight specific links to its new site. The new site is on its own server. The current url is, e.g., http://www.example.com/products/type/great-product, where the redirect target is sub.example.com/product/type/great-product

What do I need to do to successfully get these redirects to work? I don't want to use the htaccess file unless necessary, I hear it is better to do this in a separate vhost???

Thanks!

Here is a sample of the redirects I created:

Code:
Redirect 301 /products/type http://sub.example.com/products/
Redirect 301 /products/type/widgetsandaddons/2/ http://sub.example.com/products/2
Redirect 301 /products/type/widgetsandaddons/3/ http://sub.example.com/products/3
Redirect 301 /products/type/widgetsandaddons/4/ http://sub.example.com/products/4


Top
   
PostPosted: Tue Aug 14, 2012 11:33 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Is mod_alias loaded? You can check with apachectl -M (or apache2ctl -M on some distros). If there isn't a line saying "alias_module" then you'll need to enable it.


Top
   
PostPosted: Wed Aug 15, 2012 11:05 am 
Offline
Newbie

Joined: Tue Aug 14, 2012 2:01 pm
Posts: 2
Hi, thanks for getting back to me! Yes, alias_module is loaded...


Top
   
PostPosted: Thu Aug 16, 2012 3:34 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
In your example, http://www.example.com/products/type/great-product would redirect to http://sub.example.com/products//great-product . First, you should leave the trailing slashes off all the URLs and URL-paths. Second, make sure the destination pages live at the URLs you're redirecting to. Third, check the Apache logs to see what's happening? The docs may help; I don't think I have much else to offer at this point...


Top
   
PostPosted: Thu Aug 16, 2012 4:51 am 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ă…lesund, Norway
Skype: neonnero
Twitter: neonnero
Have you reloaded the Apache config as well?

If you put the new configuration in a .htaccess file, no reload is necessary, but if you put these directly in a vhost config file, you need to reload the config with /etc/init.d/apache2 reload.


Top
   
PostPosted: Thu Aug 16, 2012 9:49 am 
Offline
Senior Member

Joined: Sun May 23, 2010 1:57 pm
Posts: 315
Website: http://www.jebblue.net
I'd use this in the VirtualHost config:

ProxyPass /products/type http://sub.example.com/products/
ProxyPassReverse /products/type http://sub.example.com/products/


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group