Php Opencart SEO重写404错误

Php Opencart SEO重写404错误,php,apache,.htaccess,mod-rewrite,url-rewriting,Php,Apache,.htaccess,Mod Rewrite,Url Rewriting,我为一个经营网店的人工作。现在,webshop在Opencart软件上运行,幸运的是,它们支持SEO Url重写。在过去的两个小时里,我一直在努力让它正常工作,但一直没有成功。我对.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 .htacce

我为一个经营网店的人工作。现在,webshop在Opencart软件上运行,幸运的是,它们支持SEO Url重写。在过去的两个小时里,我一直在努力让它正常工作,但一直没有成功。我对.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 /opencart/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [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]
有人能为我找到解决办法吗


给你一个例子,我想要下面的链接:看起来像这样:

你不必把这个 重写基本/opencart/

如果您的url类似于yourDomain.com/opencart/index。。。。然后 您将不得不将RewriteBase/opencart/ 如果结束;:)

使用您的url,您不必放置RewriteBase/opencart/ 只有/


问候

好吧,哇,我刚刚发现我一直都很愚蠢。我有2.htaccess文件。一个是没有正确重写规则的原始文件,一个在my/opencart/文件夹中,有正确重写规则。我现在所做的是将正确的重写规则放入根文件夹中的.htaccess文件中,解决了这个问题!!:D

您将站点放在子目录中,因此必须进行以下更改

RewriteBase/opencart/更改为RewriteBase/

RewriteRule^([^?]*)index.php?路由=$1[L,QSA]更改为
重写规则^([^?]*)/opencart/index.php?route=$1[L,QSA]

首先,感谢您的回答。我试着将它改为just/而不是/opencart/但仍然不起作用。得到完全相同的404错误。
Not Found

The requested URL /aquaria/adm-aquaria was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.