开发者

Redirect any page passing certain variables

开发者 https://www.devze.com 2023-04-03 06:57 出处:网络
I\'m putting a search engine on my site, and the search box appears on several different pages. The output looks like this: http://mysite.com/mypage.php?bluepart=search&keywords=dogs&go=Go

I'm putting a search engine on my site, and the search box appears on several different pages. The output looks like this: http://mysite.com/mypage.php?bluepart=search&keywords=dogs&go=Go I'm trying to do an .htaccess mod rewrite to where any page that passes these variables will get redirected to search_results.php. The bluepart=search and go=Go will always be the same, but keywords can be any number or words. Also, some of my pages are .html and some are .php, when I refer to any page that passes the v开发者_JAVA百科ariables.


Take a look at the RewriteCond option. It allows you to specify a rewrite if an regular expression matches the Query string (QUERY_STRING).

0

精彩评论

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