gpt4 book ai didi

.htaccess - 如何删除htaccess中的url参数

转载 作者:行者123 更新时间:2023-12-05 02:25:12 26 4
gpt4 key购买 nike

<分区>

我有一个不喜欢添加 url 参数的 codigniter 站点例如 mysite.com/page/value 很好但是mysite.com/page/value?url=parameters 不好。

Google 广告事件附加了用于跟踪的 url 参数,我想摆脱这些以调用 Codeigniter。 (我知道在 codeigniter 中有几种方法可以做到这一点,但我想在 htaccess 级别做到这一点)

我的 htaccess 是:

<IfModule mod_rewrite.c>
RewriteEngine On

# This is different between local host and production server!!!
RewriteBase /


#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>

我应该如何更改它以使其忽略 url 参数但仍然接受 mysite/a/b/url?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com