首页 > 解决方案 > 我总是观察到这个错误 "invalid rewrite base" ,我的程序不工作

问题描述

我总是看到这个错误:(2019-02-07 12:31:48.595 [ERROR] [/home/shopph/domains/example.com/public_html/.htaccess:4] Invalid rewrite base: ' http://example. com/ ')

我在 .htaccess 中的代码如下:

Options All -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase http://example.com/
RewriteRule ^index\.php - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]
#RewriteRule . index.php [L]
</IfModule> 

上述错误阻止运行我的程序。如果您能帮助我解决我的问题,我将不胜感激。此致

标签: .htaccessmod-rewrite

解决方案


根据我对您的情况的了解,您必须改变:

RewriteBase http://example.com/

RewriteBase /

如果它不起作用,您必须提供有关您的目标的更多详细信息。


推荐阅读