gpt4 book ai didi

mod-rewrite - 为什么重写模块在 .htaccess 中不起作用

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

我试图让我的 htaccess 文件使用这个:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

重写这个网址:
http://ex.com/index.php?do=some

最佳答案

这很容易:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^index/([^/]+)/?$ index.php?action=$1 [QSA,L]

当有人点击 example.com/index/something ,它将发送到 index.php?action=something
好?

关于mod-rewrite - 为什么重写模块在 .htaccess 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52726974/

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