我在安装应用程序时遇到htaccess文件的问题,URL出现了问题。对于每个文件通常都是同样的问题,我的浏览器找不到特定文件的绝对路径,但它只搜索相对URL,例如,在我的header.tpl(在/templates/templates/header.tpl
中),我有:
<a href="/browser/browser">{#browse#}
我找不到错误:
http://localhost/browser/browser
404 not found
但该文件位于http://localhost/templates/templates/browser/browser
Firebug也给了我:
GET ttp://localhost/ajax/session_keeper (should be GET ttp://localhost/templates/templates/ajax/session_keeper)
404 Not Found
69ms
jquery....min.js (line 141)
"NetworkError: 404 Not Found - http://localhost/ajax/session_keeper"
我的项目结构如下:
htdocs/
-css/
-design/
-giude/
-images/
-inc/
-js/
-smarty/
-templates/
cache/
configs/
templates/
ajax/(This is the problematic folder)
admin/
...
templates_c/
-uploads/
htaccess
index.php
我有.htaccess文件:
RewriteEngine On
RewriteRule ^([A-Za-z0-9-_]+)/?$ /index.php?a=$1 [L]
RewriteRule ^([A-Za-z0-9-_]+)/([A-Za-z0-9_]+)/?$ /index.php?a=$1&b=$2 [L]
RewriteRule ^([A-Za-z0-9-_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9\_]+)/?$ /index.php?a=$1&b=$2&p1=$3 [L]
RewriteRule ^([A-Za-z0-9-_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9\_]+)/([A-Za-z0-9\_]+)/?$ /index.php?a=$1&b=$2&p1=$3&p2=$4 [L]
RewriteRule ^([A-Za-z0-9-_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9\_]+)/([A-Za-z0-9\_]+)/([A-Za-z0-9\_]+)/?$ /index.php?a=$1&b=$2&p1=$3&p2=$4&p3=$5 [L]
RewriteRule ^([A-Za-z0-9-_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9\_]+)/([A-Za-z0-9\_]+)/([A-Za-z0-9\_]+)/([A-Za-z0-9\_]+)/?$ /index.php?a=$1&b=$2&p1=$3&p2=$4&p3=$5&p4=$6 [L]