Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/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 重写的干净URL不显示为默认URL_.htaccess_Url_Mod Rewrite_Seo_Clean Urls - Fatal编程技术网

.htaccess 重写的干净URL不显示为默认URL

.htaccess 重写的干净URL不显示为默认URL,.htaccess,url,mod-rewrite,seo,clean-urls,.htaccess,Url,Mod Rewrite,Seo,Clean Urls,我已经使用.htaccess文件为我的站点创建了重写的URL 这是文件的内容 RewriteEngine On RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ myfile.php?firstvar=$1&secondvar=$2&thirdvar=$3&fourthvar=$4 当我检查时,我发现我的站点页面的新的干净URL已经成功创建。像这样: www.mydomai

我已经使用
.htaccess
文件为我的站点创建了重写的URL

这是文件的内容

RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ myfile.php?firstvar=$1&secondvar=$2&thirdvar=$3&fourthvar=$4
当我检查时,我发现我的站点页面的新的干净URL已经成功创建。像这样:

www.mydomain.com/value1/value2/value3/value4
对于原始URL:

www.mydomain.com/myfile.php?firstvar=value1&secondvar=value2&thirdvar=value3&fourthvar=value4
新域正确重定向到原始页面,看起来更清晰。我喜欢

但问题是,当我单击主页上的页面时,它仍然显示原始url。如果我在地址栏中输入新的干净URL,它会正确重定向到页面,但它不是默认URL。它在那里,但它不会自然出现在网站上


如何为我的网站设置新的URL和dafault URL?(仍在使用
.htaccess
可能?

已解决。我只是修改了一些PHP文件来呈现我想要的结果。我的问题现在看起来很愚蠢…但我不会删除它,以防将来有人有同样的问题。我刚刚更改了PHP文件中自动生成的a href模式。抱歉这么傻:P