【发布时间】:2017-03-03 20:15:22
【问题描述】:
我确实在互联网上搜索过,但找不到有关它的答案。我对重写规则的了解非常有限或一无所知。有人可以帮助我或指出我正确的方向。
问题是这样的:
- 我有一个网站:example.com
- 我无法使用
example.com访问它,但使用example.com/example/可以正常工作 - 我尝试了几个重写规则,但无法使其与
example.com一起使用 -
这是我的
.htaccess,它与example.com/example一起使用RewriteEngine On RewriteBase /example/ RewriteCond $1 !^(index.php) RewriteCond %{REQUEST_URI} ^doc.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^app.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] RewriteRule ^assets/uploads/.*\.(htaccess|htpasswd|ini|phps?|fla|psd|log|sh|zip|exe|pl|jsp|asp|htm|sh|cgi|py)$ - [F] 此 Web 服务器也在 ELB 后面,我已在虚拟主机中添加此配置以将
http重定向到https
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]
如何让我的网络服务器使用example.com 访问它,并从http 重定向到https
请帮我改写规则等
提前致谢
【问题讨论】:
标签: apache .htaccess redirect mod-rewrite url-rewriting