如何在不更改URL的情况下重定向.htaccess文件

时间:2015-07-27 15:34:59

标签: .htaccess mod-rewrite redirect url-redirection

我想将几个页面重定向到带有GET变量的PHP页面。但是,当我尝试使用.htaccess文件时,它会重定向但更改URL。我不希望它在重定向时更改URL结构。我该怎么做?

例如,我想将/fly-snooze-cruise重定向到http://example.com/package_listing.php?package-type=fly-snooze-cruise

/fly-snooze-cruise/orlando-airporthttp://example.com/package_listing.php?package-type=fly-snooze-cruise&airport=orlando-airport

这是我的.htaccess代码:

Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /

RewriteRule ^fly-snooze-cruise$ http://www.example.com/package_listing.php?package-type=fly-snooze-cruise [L]
RewriteRule ^fly-snooze-cruise/orlando-airport$ http://www.example.com/package_listing.php?package-type=fly-snooze-cruise&airport=orlando-airport [L]
RewriteRule ^fly-snooze-cruise/orlando-sanford-airport$ http://www.example.com/package_listing.php?package-type=fly-snooze-cruise&airport=orlando-sanford-airport [L]
RewriteRule ^fly-snooze-cruise/melbourne-airport$ http://www.example.com/package_listing.php?package-type=fly-snooze-cruise&airport=melbourne-airport [L]
RewriteRule ^snooze-park-cruise$ http://www.example.com/package_listing.php?package-type=snooze-park-cruise [L]

0 个答案:

没有答案