.htaccess - HTTP 错误 500 - htaccess 文件相关

标签 .htaccess http opencart

我的网站目前给我一个 HTTP 错误 500。这似乎是前端不工作,因为后端 (/admin) 与位于同一 VPS 上的电子邮件和子域一样工作。我已经联系了我的房东,他们告诉我他们这边没有错误,所以一定是我这边。

我的 htaccess 文件当前读取:

order allow,deny
deny from 188.143.232.
allow from all

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>


# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing 
Options -Indexes



# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes / 

#RewriteBase /
#RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
#RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
#RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
#RewriteRule ^image-smp/(.*) index.php?route=product/smp_image&name=$1 [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
 #php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
#php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
 #php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
 #php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
 #php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
 #php_value max_input_time 200

# 7. disable open_basedir limitations
 #php_admin_value open_basedir none

Upon troubleshooting I commented out the line:

RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

这让网站可以正常工作,直到今天早上我还这么认为,因为它又给我 HTTP 错误 500。

我很确定这个文件中有错误,但我不明白是什么触发了它,因为在对其进行任何更改之前它一直运行良好。

请提供任何建议,我对此很陌生,非常感谢任何人的帮助。

谢谢

保罗

最佳答案

尝试添加

之前:

重写基数/

之后:

RewriteBase/网站名

希望对您有所帮助。

关于.htaccess - HTTP 错误 500 - htaccess 文件相关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42504698/

相关文章:

ruby-on-rails - Rails 中的 RSpec 测试和 304 HTTP 状态码

javascript - node.js request.js 不并行触发请求

.net - .NET 中的 HTTP 身份验证

php - REGEX 永远不会与 .htaccess 中的 Origin 匹配

angularjs - Ionic - 跨源请求被阻止问题

php - 旧浏览器中带有https的错误网站

apache - 重定向到子目录并保留查询字符串作为文件名的一部分

php - Opencart 管理员端的空白页

php - 通过 .htaccess 将额外的 get 变量附加到 URL

opencart - 如何在管理 Controller 中加载目录模型