我正在尝试重新设计一个网站,并且我已经使用服务器网站的副本设置了本地主机。 但重定向后连接被拒绝。 我有这个代码
<meta http-equiv="refresh" content="0; url=http://localhost/vfino/v11">
原来是
<meta http-equiv="refresh" content="0; url=http://www.vfconsult.com.pt/">
我在根目录下也有这个 .htacces
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/new/
RewriteCond %{REQUEST_URI} !^/imagens/
RewriteCond %{REQUEST_URI} !^/v11/
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
#RewriteRule ^(.*)$ v11/$1 [L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^vfconsult\.com\.pt$ [OR]
RewriteCond %{HTTP_HOST} ^www\.vfconsult\.com\.pt$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/www\.vfconsult\.com\.pt\/v11/$1" [R=301,L]
我已尝试将远程 URL 更改为本地主机,但连接仍然被拒绝。 我非常感谢你的帮助。 谢谢。
最佳答案
如果我可以访问 http://vfconsult.com.pt/
它会转到本地主机但是如果我访问 vfconsult.com.pt/v11/
它会重定向到https://www.vfconsult.com.pt/v11/
即远程网站(生产)
关于php - 本地主机拒绝连接重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48596328/