2

对于 URL 重写,我得到了静态 URL 的输出但是,对于动态 URL,我只得到部分输出。我只将 .htaccess 文件放在根目录中。这是代码:

选项 +FollowSymLinks RewriteEngine on RewriteRule ^booking/price/([0-9]+)/?$ booking.php?price=$1

解决方案是什么?

4

2 回答 2

1
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^booking/([0-9]+)/?$ booking.php?price=$1
RewriteRule ^booking/([0-9]+)/([0-9]+)/?$ booking.php?price=$1&pass=$2

您确实希望为这些自定义代码,以便能够使用一般规则,而不是将特定路径转换为使用 $_GET。

于 2010-07-16T07:50:37.927 回答
-1

选项 +FollowSymLinks RewriteEngine on RewriteRule ^booking/([0-9]+)/?$ booking.php?price=$1 RewriteRule ^booking/([0-9]+)/([0-9]+)/? $ booking.php?price=$1&pass=$2

对于图像和 Css,您需要在 htaccess 文件中将基本文件夹定义为 RewriteBase /~your folder/

于 2017-07-28T18:52:34.203 回答