Forum Moderators: phranque

Message Too Old, No Replies

.htaccess not working correctly - simple rewrite

url rewrite problem

         

dubstyleenation

9:51 pm on Oct 3, 2007 (gmt 0)

10+ Year Member



Hi,

I'm having issue with rewrite urls. The .htaccess file works perfect on my localhost ,but not on 1and1.com's server. Strange. It is giving me 500 internal server error.

Here is the code:

RewriteEngine on
RewriteBase /
RewriteRule ^web-portfolio-([^/]*)\.html$ /webportfolio.php?cat=1&id=$1

Basically, I only want to change urls on 1 file named webportfolio.php. The rest of the files in the directory are .html.

I want webportfolio.php?cat=1&id=5 to say web-portfolio-5.html.

Am I doing it right? Any reason why it won't work on 1and1's servers?

Thanks

-r

jdMorgan

10:16 pm on Oct 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may need to add "Options +FollowSymLinks" at the top of your code.

If that does not help, see your server error log -- It should contain a specific reason for the server error.

Jim

dubstyleenation

10:43 pm on Oct 3, 2007 (gmt 0)

10+ Year Member



I called 1and1 and they fixed the problem. They said I had a weird character in the code and they couldn't explain it. I smell something fishy. I looked at the original code and at 1and1's edited code and both looked exactly the same. Now I'll never know what was wrong.