开发者

Rewrite all URLs except one

开发者 https://www.devze.com 2023-04-13 05:38 出处:网络
I have a site that\'s moved to a new home. I\'d like to redirect all of that site\'s URLs (domain.com开发者_开发问答/*) to domain.com/index.php except domain.com/image.png. Can anybody suggest a mod_r

I have a site that's moved to a new home. I'd like to redirect all of that site's URLs (domain.com开发者_开发问答/*) to domain.com/index.php except domain.com/image.png. Can anybody suggest a mod_rewrite rule that would rewrite all URLs except the URL for the image file?


Try this:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/image.png$
RewriteRule (.*) index.php?page=%{REQUEST_URI} [L,NC,QSA]
0

精彩评论

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