重写/到/mypage.html没有重定向

时间:2015-01-18 14:33:57

标签: apache .htaccess mod-rewrite

我想更改主页

http://www.example.com/

显示来自

的内容
http://www.example.com/mypage.html

.htaccess只有方法。

我不希望页面重定向。我需要首页显示来自同一网站的不同内容。从字面上切换主页现在改为显示类别页面。


这是当前的magento .htaccess文件

DirectoryIndex index.php
<IfModule mod_php5.c>
    php_value memory_limit 256M
    php_value max_execution_time 18000
    php_flag magic_quotes_gpc off
    php_flag session.auto_start off
    php_flag suhosin.session.cryptua off
    php_flag zend.ze1_compatibility_mode Off
</IfModule>

<IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>

<IfModule mod_deflate.c>
</IfModule>

<IfModule mod_ssl.c>
    SSLOptions StdEnvVars
</IfModule>

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^/?$ /furniture/living-room.html
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]
</IfModule>
    AddDefaultCharset Off
    AddDefaultCharset UTF-8
<IfModule mod_expires.c>
    ExpiresDefault "access plus 1 year"
</IfModule>
    Order allow,deny
    Allow from all
<Files RELEASE_NOTES.txt>
    order allow,deny
    deny from all
</Files>

我的网站是http://www.onemegamarket.com/

1 个答案:

答案 0 :(得分:1)

[L]标志添加到重写规则中,以避免匹配catch-all。

RewriteRule ^/?$ /furniture/living-room.html [L]
相关问题