我有一个基本的网页和目录网站。目前,登陆主页位于https://www.example.com/index.php。
我想添加一个营销登陆页面,位于:https://www.example.com/app/index.php
我想让我的访问者登陆营销页面,当他们来到我的网站的领域。当然,我想到了.htaccess重定向,但它似乎不起作用。
//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com[nc]
RewriteRule ^(.*)$ https://www.example.com/$1 [r=301,nc]
// Redirect landing page
Redirect /app/index.php /index.php现在我收到了错误:
内部服务器错误服务器遇到内部错误或配置错误,无法完成请求。
发布于 2018-10-26 21:07:06
您可以在站点根.htaccess中使用这些规则:
Options +FollowSymLinks
RewriteEngine on
# Rewrite to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,NE,L]
# Redirect landing page
Redirect ^app/index\.php$ /index.php [L,NC]还请注意,.htaccess只支持以#开头的注释
https://stackoverflow.com/questions/53015796
复制相似问题