开发者

.htaccess: Rewrite Problem

开发者 https://www.devze.com 2022-12-28 08:41 出处:网络
I\'m creating a website. I have this code in the .htaccess file: RewriteEngine On RewriteRule ^/([-a-zA-Z0-9开发者_开发技巧_]+)/$ /redirect.php?id=$1

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?


Try this instead:

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消