简体   繁体   English

htaccess FallbackResource重定向根域

[英]htaccess FallbackResource redirecting root domain

I am using FallbackResource to redirect any missing links to /user.php but it will redirect root domain ("incupe.com") too. 我正在使用FallbackResource将所有丢失的链接重定向到/user.php,但它也会重定向根域(“ incupe.com”)。 It shouldn't redirect that! 它不应该重定向! It will only stop redirecting if "incupe.com/index.php" is explicitly entered. 仅当明确输入“ incupe.com/index.php”时,它才会停止重定向。 Please help! 请帮忙! This is my .htaccess file: 这是我的.htaccess文件:

# Do not remove this line or mod_rewrite rules and search engine friendly URLs will stop working
RewriteBase /

# Always use https for secure connections
# Replace 'www.example.com' with your domain name
# (as it appears on your SSL certificate)
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.incupe.com/$1 [R=301,L]

Options All -Indexes
FallbackResource /user.php

Thanks in advance! 提前致谢!

If you only want to redirect missing links to user.php, put the following into .htaccess instead of your code. 如果只想将丢失的链接重定向到user.php,则将以下内容放入.htaccess中,而不是代码中。

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ user.php [L]

Options All -Indexes

If you have any virtual URLs, this won't work. 如果您有任何虚拟网址,则将无法使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM