Php 产品页面的Codeigniter url问题

Php 产品页面的Codeigniter url问题,php,codeigniter,Php,Codeigniter,我有一个Codeigniter网站,我有一个问题,我所有的产品URL都有两个不同的URL。 我只希望每个产品有一个单一的网址 Like for a product: https://www.bentleypartsusa.com/category/products_listing/138/ https://www.bentleypartsusa.com/category/products_listing/138/pg/ 每个产品有两个URL。那么我该如何解决这个问题呢 这是我的htacces

我有一个Codeigniter网站,我有一个问题,我所有的产品URL都有两个不同的URL。 我只希望每个产品有一个单一的网址

Like for a product:

https://www.bentleypartsusa.com/category/products_listing/138/
https://www.bentleypartsusa.com/category/products_listing/138/pg/
每个产品有两个URL。那么我该如何解决这个问题呢

这是我的htaccess文件

<IfModule mod_rewrite.c>

    Options +FollowSymLinks -Indexes
    Options -MultiViews
    RewriteEngine on
    
    RewriteCond %{SERVER_PORT} ^80$
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.bentleypartsusa.com/$1 [L,R=301]
    RewriteCond %{REQUEST_URI} ^/home$
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/ [R=301,L]

    Redirect /home/car-red/feed/ https://www.bentleypartsusa.com/
    Redirect /members/wishlist.html https://www.bentleypartsusa.com/
    Redirect /pages/download_document/document/dumymy_pdf2.pdf https://www.bentleypartsusa.com/
    Redirect /captcha/normal/15208659655aa692ad4f997 https://www.bentleypartsusa.com/
    Redirect /captcha/normal/15653168405d4cd6e827d9e https://www.bentleypartsusa.com/
    Redirect /captcha/normal/15286640755b1d900b1e51a https://www.bentleypartsusa.com/
    
    # Keep people out of codeigniter directory and Git/Mercurial data
    RedirectMatch 403 ^/(system\/cms\/cache|system\/codeigniter|\.git|\.hg).*$

    # Send request via index.php (again, not if its a real file or folder)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    <IfModule mod_php5.c>
        RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>

    <IfModule !mod_php5.c>
        RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>

</IfModule>

选项+FollowSymLinks-索引
选项-多视图
重新启动发动机
重写cond%{SERVER_PORT}^80$
重写规则^.*$https://%{SERVER_NAME}%{REQUEST_URI}[R=301,L]
重写cond%{HTTP_HOST}^www\。
重写规则^(.*)$https://www.bentleypartsusa.com/$1[L,R=301]
重写cond%{REQUEST_URI}^/home$
重写规则^(.*)$https://%{HTTP_HOST}/[R=301,L]
重定向/主/车红色/馈送/https://www.bentleypartsusa.com/
重定向/members/wishlist.htmlhttps://www.bentleypartsusa.com/
重定向/pages/download_document/document/dummy_pdf2.pdfhttps://www.bentleypartsusa.com/
重定向/验证码/正常/15208659655aa692ad4f997https://www.bentleypartsusa.com/
重定向/验证码/正常/15653168405d4cd6e827d9ehttps://www.bentleypartsusa.com/
重定向/验证码/正常/15286640755b1d900b1e51ahttps://www.bentleypartsusa.com/
#让人们远离codeigniter目录和Git/Mercurial数据
重定向匹配403^/(系统\/cms\/cache |系统\/codeigniter | \.git | \.hg)*$
#通过index.php发送请求(同样,如果是真实的文件或文件夹,则不发送请求)
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L]
重写规则^(.*)$index.php?/$1[L]
非常感谢您的帮助


TIA

请先显示您的代码您使用什么路线?您是否使用分页或/pg?请检查现在添加的.htaccess文件代码问题出在哪里,您想要上面的两个URL中的哪一个?看看这个(你的)问题,url是,但也可以,自动添加slug部分我想从slug中删除/pg请先显示你的代码你使用什么路由?您是否使用分页或/pg?请检查现在添加的.htaccess文件代码问题出在哪里,您想要上面的两个URL中的哪一个?看看这个(你的)问题,url是,但也可以,自动添加slug部分我想从slug中删除/pg