【发布时间】:2012-07-25 01:30:52
【问题描述】:
编辑:
我想重定向一个网址
到:www.example.com/location/sydney
来自:www.example.com/rss.php?pickup=sydney
问题是我无法从 www.example.com/location/sydney 获取 $_GET['pickup'] 值,并且位置也会更改,例如:它可能是凯恩斯、伦敦等。我有一个名为 rss 的文件。 php 中,我将从 $_GET['pickup'] 中获取值。
我试过这个:- Redirect /location http://deals.vroomvroomvroom.com.au/rss.php
但它给了我一个 url :- http://deals.vroomvroomvroom.com.au/rss.php/sydney 当我输入 url www.example.com/location/sydney
【问题讨论】:
-
您是要重写还是重定向?您是否希望用户查看/使用像
http://www.example.com/location/sydney这样的 URL,但要处理的代码是 index.php,其中包含 GET 中的位置元素?或者您是否尝试向http://www.example.com/?location=sydney发出请求,导致用户在其地址栏中以http://www.example.com/location/sydney结束?还是你真的想要两者?
标签: php .htaccess mod-rewrite