【发布时间】:2013-06-19 17:43:17
【问题描述】:
我想在地址栏上显示我的 index.html 文件。当您转到http://www.example.com/ 将其重定向到http://www.example.com/index.html 并在地址栏上显示该 index.html。
编辑
这是我的 .htaccess 文件。我尝试过 neo 示例,但没有成功。
DirectoryIndex naslovnica.php
Options -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* 404.html [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /naslovnica\.php
RewriteRule ^naslovnica\.php$ http://example.com/naslovnica.php [R=301,L]
【问题讨论】:
-
你试过了吗?
标签: apache mod-rewrite