0

How to rewrite img.php?p=$id to img/$id in .htaccess, where $id is id of the image in database?

I tried this, but I get error - nothing found.

RewriteEngine On
RewriteBase /
RewriteRule img/^([0-9_-]+)$ img.php?p=$1
RewriteRule img/^([0-9_-]+)/$ img.php?p=$1
4

1 回答 1

1

用以下代码替换您的代码:

RewriteEngine On
RewriteBase /
RewriteRule ^img/([0-9_-]+)$ /img.php?p=$1 [L,QSA,NC]
于 2013-03-26T21:11:42.107 回答