重写激活后如何解决页面错误

时间:2018-11-07 22:16:05

标签: .htaccess url-rewriting apache2.4

我有一个问题广告,我不知道问题是否是内部的以及如何识别错误。

在通过htaccess激活重写之前,我的第一个URL是(使用index.php):

https://...../demo/index.php/Products/Description/products_id-1

激活htaccess后,URL变为(whithout index.php):

https://...../Products/Description/products_id-2

问题是:单击链接时,我的网站上出现404错误。

您有想法吗? 谢谢

Options -Indexes
Options +FollowSymlinks
Options -MultiViews

AcceptPathInfo on

<IfModule mod_rewrite.c>
RewriteEngine On

#example1
#https://clicshopping.net/demo/Products/Description/products_id-2
#rewrite the good directory in function your website
  RewriteBase /demo/
#1) redirect the client from "/index.php/foo/bar" to "/foo/bar"
RewriteCond %{THE_REQUEST} /index\.php/(.+)\sHTTP [NC]
RewriteRule ^ /%1 [NE,L,R]
#2)internally map "/foo/bar" to "/index.php/foo/bar"
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /index.php/$1 [L]
</IfModule>

0 个答案:

没有答案