【发布时间】:2015-01-18 14:33:57
【问题描述】:
我要改首页
http://www.example.com/
显示来自
的内容http://www.example.com/mypage.html
.htaccess only 方法请。
我不希望页面重定向。我需要主页显示来自同一网站的不同内容。从字面上切换主页现在改为显示类别页面。
这是当前的 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>
【问题讨论】:
-
RewriteRule默认不重定向,它是内部重写。RewriteRule ^/?$ /mypage.html不行吗? -
没有不同,我现在将完整的 .htaccess 添加到原始问题
-
您正在堆叠多个重写规则。最后一条规则
.* index.php将匹配。要尽早打破您的主页规则,请添加[L](最后一个)标志。 -
我不确定这是默认的 magento .htaccess
标签: apache .htaccess mod-rewrite