我正在使用.htccess文件来重写我的URL。我在.htaccess文件中使用以下规则:使用URL重写的问题(相对路径不起作用)
Options +FollowSymlinks
RewriteEngine on
RewriteBase/
RewriteRule ^product/([0-9]+)/([A-Za-z0-9+]+)$ /product.php?productid=$1&prodname=$2
重写工作正常。
但是,当我尝试通过所有情况下的相对路径访问任何其他页面时,URL没有正确重定向。
就像下面的例子
<form action "something.php" method="post">
<input type="text" name="1" />
<input type="submit" value="submit" />
</form>
当我点击提交,这被载入的页面是http://mydomain/product/1/something/something.php
不存在的,因此抛出一个404错误
我使用的基本标记尝试头,但这会产生问题,而我正在使用页面锚点和模态窗口。它被重定向到索引页面。
请让我知道是否需要更多细节。
我对此很新颖。那么,有人可以帮助我吗?
由于事先 卡尔蒂克
它真的是整个.htaccess文件吗?如果你有权访问主Apache配置,你可以启用mod_rewrite日志来帮助调试这些问题。 – 2009-06-02 11:47:47