Forum Moderators: phranque

Message Too Old, No Replies

htaccess redirect - cobalt Raq with apache

.htaccess redirectors with cobalt

         

Paolodangelo

5:22 pm on Mar 18, 2005 (gmt 0)

10+ Year Member



Hi,

Excuse my lack of knowledge on the subject. I have created a .htaccess file which previously worked on a former host. I have since moved it to a cobalt raq with apache and it gives me a 500 message. The code I was formely using was this:

ErrorDocument 404 /404.asp

Redirect /brief.htm [mydomain.co.uk...]

For example. It is essential that I be able to somehow redirect incoming pages to the correct place or I will be severely marked down for SEO.

I read in a former post using htaccess to redirect to a PERL script called index.cgi, but I must confess I am not a PERL scripter and have no knowledge of how to do this or what I would need to do in order to get it to work.

If anyone has any examples they could show me or help in any way, links or anything, I would be eternally grateful.

Thanks

Paolodangelo

6:30 pm on Mar 18, 2005 (gmt 0)

10+ Year Member



Also tried :

RewriteEngine On
RewriteRule ^index\.html$ [mydomain.co.uk...] [R=301,L]

but with the same results. :o(

Longhaired Genius

6:34 pm on Mar 18, 2005 (gmt 0)

10+ Year Member



this is a bit confusing. You've mentioned file extensions: .htm .html .php and .asp. What are the actual names of the files you are trying to redirect.

jetboy

7:05 pm on Mar 18, 2005 (gmt 0)

10+ Year Member



Well, your code is correct (the first version), so it suggests that your .htaccess file isn't enabled. In Apache's httpd.conf file you need to have the following set:

AccessFileName .htaccess

and

AllowOverride All

I think the latter's set to AllowOverride None by default. You might want to put:

<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

into your .htaccess file too, which will prevent third parties being able to access it.

Edit: Hmmm, except you're getting a 500 error, which suggests your .htaccess is working. Do you have anything else in the file apart from those two directives? Or did Longhaired Genius get it right first time about the file extensions - it's unusual to have .asp on an Apache box at all, let alone mixed in with PHP.