使用.htaccess将站点重定向到另一个URL

时间:2016-07-16 10:27:36

标签: .htaccess file url redirect

我想将我的网站重定向到同一网站的另一个网址 例如:example.org到example.org/index.php或example.org/index.php/install/login

当我访问我的网站时,它会自动重定向到example.org/install/login。这会导致错误。

The requested URL /install/login was not found on this server. 

我在.htaccess文件中编辑了很多

这是我当前的.htaccess文件

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    DirectoryIndex index.php    
    Redirect 301 / http://example.org/index.php

    #RewriteEngine On
#    RewriteCond %{HTTP_HOST} ^example.org
#    RewriteRule ^(.*) http://example.org/index.php/install/login [P]

    # Redirect Trailing Slashes If Not A Folder...
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    #RewriteCond %{HTTP:Authorization} .
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

0 个答案:

没有答案
相关问题