我想将几个页面重定向到带有GET变量的PHP页面。但是,当我尝试使用.htaccess文件时,它会重定向但更改URL。我不希望它在重定向时更改URL结构。我该怎么做?
例如,我想将/fly-snooze-cruise
重定向到http://example.com/package_listing.php?package-type=fly-snooze-cruise
和/fly-snooze-cruise/orlando-airport
到http://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]