Php Opencart启用SEO url导致404错误

Php Opencart启用SEO url导致404错误,php,opencart,shopping-cart,Php,Opencart,Shopping Cart,我正在为我们的网站使用opencart版本1.5.5.1 当我在管理部分启用seo时,URL会导致404。 我的网站网址是。 .htaccess文件内容如下所示: # 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 issu

我正在为我们的网站使用opencart版本1.5.5.1

当我在管理部分启用seo时,URL会导致404。 我的网站网址是。 .htaccess文件内容如下所示:

# 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

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
 Order deny,allow
 Deny from all
</FilesMatch>

# 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 /shop/ 

RewriteBase /dev/
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]
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]
#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
#1.要使用URL别名,您需要在启用mod#u rewrite的情况下运行apache。
# 2. 在opencart目录中,将htaccess.txt重命名为.htaccess。
#有关任何支持问题,请访问:http://www.opencart.com
选项+FollowSymlinks
#防止Directoy上市
选项-索引
#阻止直接访问文件
命令拒绝,允许
全盘否定
#搜索引擎优化URL设置
重新启动发动机
#如果您的opencart安装没有在主web文件夹上运行,请确保您的文件夹在ie中运行。/been/shop/
重写库/开发/
重写规则^sitemap.xml$index.php?route=feed/google_sitemap[L]
重写规则^googlebase.xml$index.php?route=feed/google_base[L]
重写规则^download/(.*)/index.php?route=error/not_found[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写条件%{REQUEST\u URI}!。*\。(ico | gif | jpg | jpeg | png | js | css)
RewriteRule^([^?]*)index.php?_route_uu=$1[L,QSA]
#重写规则^(.*)\?*$index.php?路由=$1[L,QSA]
###某些服务器可能需要启用的其他设置
###通过删除前面的#符号来取消对命令的注释。
###如果在启用以下任何设置后出现“内部服务器错误500”,请恢复#,因为这意味着您的主机不允许这样做。
# 1. 如果您的购物车一次只允许您添加一个项目,则可以启用register_globals。这可能会禁用它:
#php_标志寄存器_全局关闭
# 2. 如果您的购物车启用了魔法报价,这可能会使其禁用:
#php_标志魔术_引号_gpc关闭
# 3. 设置最大上载文件大小。大多数主机将对此进行限制,并且不允许覆盖它,但您可以尝试
#php_值上传_最大_文件大小999M
# 4. 设置最大邮件大小。如果有很多产品选项或表单未保存所有字段时出现错误,请取消对此行的注释
#php_值post_最大尺寸999M
# 5. 设置脚本可以花费的最大时间。如果有很多产品选项或表单未保存所有字段时出现错误,请取消对此行的注释
#php_值最大执行时间200
# 6. 设置接收输入的最长时间。如果有很多产品选项或表单未保存所有字段时出现错误,请取消对此行的注释
#php_值最大输入时间200
# 7. 禁用open_basedir限制
#php\u admin\u值open\u basedir无
我知道这个主题已经发布了,但是提供的解决方案对我不起作用


请帮帮我。提前谢谢

首先,我认为默认情况下不启用“重写模式”。根据发行版启用它。对于ubuntu-
sudoa2enmod重写

尝试将
/etc/apache2/sites enabled/yousiteFile中的
AllowOverride none
更改为
AllowOverride All

Ubuntu和一些发行版的工作方式不同。其次,默认vhost的override设置为none,因此不允许htaccess重写任何内容


重新启动apache。

是的,
AllowOverride All
使SEO URL适合我

如上所述,确保

sudo a2enmod重写

在Apache上启用重写


然后确保已将RewriteEngine On添加到
/etc/apache2/sites available/

中的域中,检查此列表以搜索一些错误:

  • 重命名为.htaccess.txt->.htaccess

  • 在Apache2上启用Mod_重写:
    a2enmod重写
    然后
    重新启动Apache2服务

  • 更改了apache2.conf文件,位于/etc/apache2/: 在哪里

  • 
    选项索引跟随符号链接
    不允许超限
    要求所有授权
    
    你换成

    
    选项索引跟随符号链接
    允许超越所有
    要求所有授权
    

    我有一个http 404错误的解决方案。即使我在起步时也遇到了困难,但现在很容易解决

    登录Opencart管理员。。然后编辑设置。然后在服务器部分禁用使用SEO url。那么你不会得到任何错误。再见

    或者,如果您不想禁用url,请遵循下面的方法

    只需将
    .htaccess.txt
    编辑为
    .htaccess

    您将在根文件夹中获得此文件。

    您是否将
    .htaccess.txt
    文件重命名为
    .htaccess
    文件(扩展名为no.txt)??它是.htaccess而不是.htaccess.txt。您的服务器是否运行Apache?Hi..@SankarV…您是否为此使用了任何模块…SEO?Hi@SankarV…我对SEO扩展名的建议。。。。免费)。。