用.htaccess美化网址

时间:2016-12-02 15:29:07

标签: php apache .htaccess mod-rewrite

我试过通过阅读其他人的类似问题来解决这个问题,但我仍然没有让它正常工作。 我正在使用opencart.com。 当我查看单个产品页面它是正确的像: /紫袖毛衣 /蓝套筒毛衣

但是当我查看页面下的所有产品时,我得到了     ?的index.php路线=产品/类别&安培;路径= 13_15

我的联系页面和博客也是这样的     ?的index.php路线=产品/类别&安培;路径2 =     ?的index.php路线=产品/类别&安培;路径= 3

但我希望能/联系我们和/ blog

我的博文就像这样出来了     ?的index.php路线=产品/类别&安培;路径= 3_16

然而所有个别产品都正确出现。

以下内容来自我的.httaccess:

Options +FollowSymlinks

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
 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 /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} =""
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
#RewriteRule ^([0-9]+).php/?id=$1 [QSA,L]
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.

缺少什么以及在网址

中创建我的页面/帖子名称的位置

0 个答案:

没有答案