.htaccess Redirect 301 Error

4 posts / 0 new
Last post
#1 Tue, 10/18/2011 - 11:18
bwade30

.htaccess Redirect 301 Error

I have a php program that uses a Redirect 301 in the .htaccess.

Currently it's setup like this and has worked fine on my cpanel servers:

Redirect 301 /contact_page.html /contact_us.php

I've read up and found that I need to do this to get it to work...(and it does work fine this way)

Redirect 301 contact_page.html http://url.com/contact_us.php

BUT...

I'm using this .htaccess as a core file that I don't want to change everytime I install it on a new server. So is there a way to maintain the original relative Redirect paths so it works with any new site? It works perfectly fine on my cpanel servers so it seems with a little configuring in apache, it would be able to work. Any ideas?

Tue, 10/18/2011 - 12:01
andreychek

Howdy,

I set that .htaccess file up as a test on my system -- and using relative URL's actually works correctly here.

What problems are you seeing when you do that exactly?

-Eric

Tue, 10/18/2011 - 12:05
bwade30

I get 500 internal server error: in apache errors log I get:

/.htaccess: Redirect to non-URL

Tue, 10/18/2011 - 23:08
bwade30

I ended up using a rewrite line. But in the meantime, do you know why I would keep getting that 500 internal server error? I'm assuming it's an apache setting or something.

Topic locked