开发者

.htaccess redirect to both index.html and .php

Currently I have a landing page html witch the domain points to but if I access /index.php it redirects back to index.html.

How could I make the index.php accessible?

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^$
Rew开发者_如何学CriteCond %{HTTP_HOST} ^domain.co.nz$
RewriteRule ^$ http://domain.co.nz/index.html [L,R=301]


You are redireting everything to the html file.

Try:

# Enable rewiting
RewriteEngine on
Options +FollowSymLinks

# set 'default' file
DirectoryIndex index.html

# everything else goes to the index.php file, except your sites assets/
RewriteCond $1 !^(index\.php|index\.html|images|css|javascript)
RewriteRule ^(.*)$ /index.php/$1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜