【发布时间】:2016-10-29 19:20:55
【问题描述】:
我最近尝试使用 htaccess 隐藏我的 url 中的参数,结果出现 500 服务器错误。
这是我的.htaccess 代码:
<files .htaccess>
order allow,deny
deny from all
</files>
Options -Indexes +FollowSymLinks
RewriteEngine on
RewriteBase /
ErrorDocument 404 /404.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{THE_REQUEST} \s(.+?)/+[?\s]
RewriteRule ^(.+?)/$ /$1 [R=301,L]
RewriteBase /
RewriteRule ^([^/]+\.php)/.* $1 [R=301,L]
RewriteRule ^buyit\.php$ /buyit.php?qstart=1&gid=73161-645821-36&qid=4&daq=0&preq=14&clk=7 [L]
我想要做的只是我的页面 buyit.php?qsta=1&gid=11-64-36&qid=4&kaq=0&req=14&dlk=7 始终显示为 buyit.php 保持我的变量完整且可用于我的 php 脚本。所以我在 htaccess 中添加了最后一行,但不幸的是它崩溃了。
请告诉我为什么?
【问题讨论】:
标签: php html .htaccess url-rewriting