[英].htaccess working locally, but not on 1and1 server
我將當前的.htaccess文件上傳到1and1服務器(實際上是1und1.de,但我猜它是一樣的)我正在調整500內部服務器錯誤。
Options -MultiViews
RewriteEngine On
RewriteBase /lammkontor
RewriteRule ^categories/([^/\.]+)/?$ index.php?url=category.php&cat_url=$1 [L]
RewriteRule ^categories/([^/\.]+)/([^/\.]+)/?$ index.php?url=product.php&cat_url=$1&prod_url=$2 [L]
RewriteRule ^categories/([^/\.]+)/([^/\.]+)/recipes?$ index.php?url=recipes.php&cat_url=$1&prod_url=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+\.php)/?$ index.php?url=$1 [QSA]
這個.htaccess在我當地的MAMP服務器上運行得很好。
當我使用示例文件在控制中心測試CGI-Monitor時,我得到了- cgi: File not present or has invalid modes (no output)
現在唯一正在運行的文件是index.php
謝謝你的幫助!
實際上我解決了我的問題,在每個重寫規則的開頭添加一個斜杠,如:
RewriteRule ^(.+\.php)/?$ /index.php?url=$1 [QSA]
代替
RewriteRule ^(.+\.php)/?$ index.php?url=$1 [QSA]
謝謝!
默認情況下,apache的htaccess
權限已關閉或受限制,具體取決於您的主機。 我懷疑你的Options -MultiViews
導致錯誤。
檢查你的httpd.conf
並檢查是否允許使用MultiViews
,如下所示。
<Directory />
Options FollowSymLinks
AllowOverride Indexes Options=All,MultiViews
Order deny,allow
Deny from all
</Directory>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.