[英]htaccess file www. redirect issue
I have a weird issue 我有一个奇怪的问题
I added the code to htaccess file to redirect any non www to www. 我将代码添加到htaccess文件中,以将任何非www重定向到www。 but now it takes me to the sub-directory the website files are on
但现在将我带到网站文件所在的子目录中
from the DNS cpanel i have pointed the domain directory to /main_web 从DNS cpanel我已将域目录指向/ main_web
when i put in throughtheglasseye.org now it takes to hxxp://www.throughtheglasseye.org/Main_web/ with the error 404 page not found 当我现在输入throughtheglasseye.org时,它进入hxxp://www.throughtheglasseye.org/Main_web/,但未找到错误404页面
here is my code - 这是我的代码-
# Redirect non-www to www:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
# Disable htaccess view:
<Files .htaccess>
order allow,deny
deny from all
# Disable directory browsing:
</Files>
IndexIgnore *
im not sure if this is correct please check and let me know what i can do to fix this 即时通讯不确定这是否正确,请检查并告知我该怎么做才能解决此问题
Thanks a lot in advance 提前谢谢
This issue is not related to mod-rewrite. 此问题与mod-rewrite不相关。
Rather ask help from your service provider (where cpanel is located). 而是向您的服务提供商(cpanel所在的位置)寻求帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.