Forum Moderators: phranque

Message Too Old, No Replies

Can't get mod_rewrite to work

         

cpnmm

11:09 am on Jan 30, 2004 (gmt 0)

10+ Year Member



Hi, I'm trying to use mod_rewrite to change .cgi files to .html files.

I have uploaded the following .htaccess file to my server but get an internal server error. Could someone who knows check that it is right?

The script is in /cgi-bin/widgets as is the .htaccess file

Options +FollowSymlinks
RewriteEngine on
RewriteBase /cgi-bin/widgets/
RewriteRule ^blue_widgets.html$ blue_widgets.cgi

Thanks very much.

jdMorgan

5:56 pm on Jan 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cpnmm,

I don't think there's anything wrong with the syntax of the code itself that would cause a 500-Server Error. What information do you get in your server error log when you make a request with this code in place?

Jim

cpnmm

6:55 pm on Jan 30, 2004 (gmt 0)

10+ Year Member



Thanks for your help Jim,

I'm afraid I don't know if I have access to the server log as I'm on a shared host - do you know what directory it would be in?

Chris

claus

7:04 pm on Jan 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This might not be helpful, it's just an idea, but...

>> script is in /cgi-bin/widgets as is the .htaccess file

Try moving the .htaccess file out of /cgi-bin/widgets/ to a higher level, eg. to the document root.

Added: Uhm..... You write:

>> to change .cgi files to .html files

The rewrite you posted does the opposite as far as i can see, ie. changes html files to cgi files - perhaps you should reverse the Rewrite Rule?