[英]Apache - Redirect /folder to /folder/index.php using .htaccess
[英]Redirect htaccess old folder to a new folder with index.php
我需要很大的帮助。 我的htaccess
配置为将所有http
内容重定向到https
并且工作正常,但仅是根内容。
我花了很多时间研究网络如何将URL而不是SSL
的网站内容重定向到新的SSL
URL,但是我发现的解决方案不适用于我的情况。
我的.HTACCESS
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R=301]
我想要的是这个。
当用户访问http://www.example.com/oldfolder/index.php?site=文档名称时,重定向到https://example.com/new-folder/other-folder/index.php?site=文件名
但是我什么也没发现。
谢谢。
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.org$
RewriteRule ^/?$ "https\:\/\/www\.example\.org\/home\/" [R=301,L]
如果有人键入example.org
则重定向将在此起作用。 该人将被重定向到example.org/home
。 要查看,请单击此处cubehub.org
如果您使用的是Cpanel,只需转到Redirects( cPanel >> Home >> Domains >> Redirects
)并设置URL重定向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.