开发者

mod_redirect every request except a.php, b.php and c.php

I have searched Google and looked here but I haven't quite found the answer I am looking for.

I am working on a little project and part of it will allow shorturl redirects, similar to bit.ly or tinyurl.com.

I would like to allow visitors to be able to view pages a.php, b.开发者_运维技巧php and c.php but everything else such as; domain.com/blahblahblah or domain.com/FirstName will be redirected to c.php which will look at the URL, then look in the DB to see if there is a matching value. If there is then redirect them.

I have everything done except the catch all mod_redirect / .htaccess redirect.

Thanks for the help.


RewriteEngine on
RewriteCond $1 !^(a\.php|b\.php|c\.php)
RewriteRule ^(.*)$ c.php?q=$1 [L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜