Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.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
.htaccess 在php中使用url中带有两个参数的htaccess重定向时出现问题_.htaccess_Url - Fatal编程技术网

.htaccess 在php中使用url中带有两个参数的htaccess重定向时出现问题

.htaccess 在php中使用url中带有两个参数的htaccess重定向时出现问题,.htaccess,url,.htaccess,Url,如何使用.htaccess从这些URL重定向 我有这样一个URL: http://localhost/try1/1/php 当我点击菜单上的contact.php页面时,我的URL变为 http://localhost/try1/1/contact.php 我想要这样 http://localhost/try1/contact.php 我的.htaccess文件: RewriteEngine On RewriteRule ^([^/\.]+)/([^/\.]+)?$ video_about

如何使用
.htaccess
从这些URL重定向

我有这样一个URL:

http://localhost/try1/1/php
当我点击菜单上的
contact.php
页面时,我的URL变为

http://localhost/try1/1/contact.php
我想要这样

http://localhost/try1/contact.php
我的
.htaccess
文件:

RewriteEngine On
RewriteRule ^([^/\.]+)/([^/\.]+)?$ video_about.php?id=$1&title=$2 

你能确切地说明你想重定向到什么地方吗?你的问题不清楚?什么是
/try1/1/php
conatact
只是你问题中的一个输入错误吗?你目前在
.htaccess
中有什么代码?我在RewriteRule^([^/\.]+)/([^/\.]+)?$video\u about.php?id=$1&title=$2上有这些htaccess代码重写引擎,当我在url中有url,并且我点击我的菜单链接时,它不会将路径更改重定向到我想使用htaccess进行更改的位置“我点击我的菜单连接它不会将路径更改重定向到”-听起来你链接到了错误的URL?(因为你的
.htaccess
中没有执行“重定向”的内容。)如果你想让URL看起来像某种方式,那么你需要实际链接到该URL-这不是你必须“修复”的东西“在
.htaccess
中,如果您正试图这样做?