想要将网址从www.domain.com/home更改为www.domain.com

时间:2014-03-28 06:49:07

标签: .htaccess

这是我的.htaccess代码:

    AddHandler x-httpd-php5-3 .php  
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f  
    RewriteCond %{REQUEST_FILENAME}/index.html !-f  
    RewriteCond %{REQUEST_FILENAME}/index.php !-f  
    RewriteRule . index.php [L]

    RewriteCond %{THE_REQUEST} /welcome/[/?\s] [NC]    
    RewriteRule ^ / [R=301,L]    

1 个答案:

答案 0 :(得分:0)

您可以在root .htaccess中使用此规则:

AddHandler x-httpd-php5-3 .php  
RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} /welcome[/?\s] [NC]    
RewriteRule ^ / [R=301,L]    

RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME}/index.html !-f  
RewriteCond %{REQUEST_FILENAME}/index.php !-f  
RewriteRule . index.php [L]