views:

19

answers:

2

Hi, I'm creating a website. I have this code in the .htaccess file:
RewriteEngine On
RewriteRule ^/([-a-zA-Z0-9_]+)/$ /redirect.php?id=$1

But when I go to, for example /ASEi it says 404 Not Found. What's the problem?

A: 

Try this instead:

RewriteRule ^/([-a-zA-Z0-9_]+)/$ /redirect.php?id=$1

Tim
It says 404 Not Found.
Francesc
A: 

I found it, the problem was the first /. The .htaccess now looks like:
RewriteEngine On
RewriteRule ^([-a-zA-Z0-9_]+)$ redirect.php?id=$1

Francesc