Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何更改url php脚本htaccess方法_Php_.htaccess_Url Rewriting - Fatal编程技术网

如何更改url php脚本htaccess方法

如何更改url php脚本htaccess方法,php,.htaccess,url-rewriting,Php,.htaccess,Url Rewriting,如何更改此url 到 .htaccess文件 <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... Rew

如何更改此url

.htaccess文件

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php?/$1 [QSA,L] 

选项-多视图
重新启动发动机
#重定向尾部斜杠。。。
重写规则^(.*)/$/$1[L,R=301]
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)index.php?/$1[QSA,L]
尝试添加字符串

RewriteRule ^(/search/song)$ $1.html [L,R=301]
就在
重新启动发动机之后

如果这不起作用,请尝试这样做:

RedirectMatch 301 ^(/search/song)$ $1.html
这应该可以很好地工作。

尝试添加字符串

RewriteRule ^(/search/song)$ $1.html [L,R=301]
就在
重新启动发动机之后

如果这不起作用,请尝试这样做:

RedirectMatch 301 ^(/search/song)$ $1.html

这应该能很好地工作。

如果你猜到我在想的数字,我告诉你许多可能性中的一个。我正在使用搜索引擎转换为change
RewriteRule^(.*)index.php?/$1[QSA,L]
for
RewriteRule^(.*)\.html$index.php?/$1[QSA,L]
可能重复的不工作我正在尝试这段代码如果你猜到我在想的数字,我会告诉你很多可能性中的一个。我正在使用搜索引擎将其转换为change
RewriteRule^(.*)index.php?/$1[QSA,L]
for
RewriteRule^(.*)\.html$index.php?/$1[QSA,L]
不工作的可能重复我正在尝试此代码我编辑了您的问题以从规则模式中删除前导斜杠,在htaccess上下文中不允许使用前导斜杠。我编辑了您的问题以从规则模式中删除前导斜杠,在htaccess上下文中不允许使用前导斜杠。