【发布时间】:2011-07-01 02:27:12
【问题描述】:
我是 Mod_rewrite 的新手,但问题是它破坏了我所有的 ajax 和 php
我使用 windows.location 对象来获取 javascript 示例的当前位置:
var str = location.pathname;
str=str.slice(0,str.lastIndexOf('/'));
自从我使用了 mod_rewrite 以来,这永远不会奏效。 我的.htaccess
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^cars/([^/]+)/?$ profiles.php?carname=$1 [L]
可以让我找到解决此问题的方法吗? ? 我在装载所有 imgs 和 css/.js 时也面临同样的问题,但我听说我可以在 .htaccess 上写条件以仅重定向 .php!,
我需要一种方法来查找 ajax 调用的基地址,以及其他方法来查找 php 的基地址。
【问题讨论】:
标签: php javascript mod-rewrite base-address