重写2个不同的URL

时间:2018-07-11 02:40:09

标签: .htaccess url-rewriting

我有这个网址: https://www.test.net/demo/index.php/Products/Description/products_id,3

如果激活重写,我将得到以下信息: https://www.test.net/demo/Products/Description/products_id,5

我的问题是网址是这样写的: https://www.test.net/demo/Products/Description/products_id,5

但是当我单击按钮时:: url就是这样 https://www.test.net/demo/index.php/Products/Description/products_id,3

由于网址不同,我总是在索引页面上回来。

在apache片段中,我也写了

 AcceptPathInfo on

在Apache 2.4上pathinfo不存在。

我的htaccess:

Options -Indexes
Options +FollowSymlinks

#### Force pathinfo apache 2.4 ###############
#AllowOverride None
#AcceptPathInfo on


<IfModule mod_rewrite.c>
    RewriteEngine On

#to change in function your website
    RewriteBase /boutique/

# remove index.php if entered directly by clients
    RewriteCond %{THE_REQUEST} /index\.php/(\S*)\s [NC]
    RewriteRule ^ %1 [L,R=301,NE]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(?!index\.php$).* index.php/$0 [L,NC]
</IfModule>

Tk

0 个答案:

没有答案