我有一个 RewriteRule 可以成功地将我重定向到相应的页面。问题是,当我将鼠标悬停在重定向页面上的链接上时,此页面上任何链接的 URL 已更改如下:
正确链接:http://www.mysitelcom/newClients.php
RewriteRule 之后的链接:http ://www.mysite.com/samples/article-title-goes-here/23/newClients.php 它已经为下一个文件请求添加了“前缀”samples/article-title-goes-here/23 / 这是我的 RewriteRule 的模式部分。
我的 .htaccess 文件是:
# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .
RewriteEngine on
RewriteBase /
# Do not do anything for already existing files and folders
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^sample/([a-zA-Z0-9-]+)/([0-9]+)$ sample.php?id=$2 [L]
谁能帮我理解我错过了什么?不知何故,我必须“重置”我的 URI,以便它不会“改变”下一个请求的文件名。谢谢你的任何想法。