2017-04-12 138 views
2

我的.htaccess是重定向问题

<IfModule mod_rewrite.c> 

    Options +FollowSymLinks 
    RewriteEngine on 

    RewriteRule ^([a-z0-9_-]+)\.html$ index.php/page/$1 [L] 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond $1 !^(index\.php|asset|robots\.txt) 
    RewriteRule ^(.*)$ index.php?/$1 [QSA,L] 

</IfModule> 

但它不是在mochahost工作,我试了几个时间,但它不工作。我怎么解决这个问题?

+0

您使用笨的什么版本,您使用的XAMPP或WAMP? – user4419336

+0

在您的服务器上启用了mod_rewrite – RiggsFolly

+0

这与mysql有什么关系? – dsharew

回答

2

试试这个代码在.htaccess作品对我来说........

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 
+0

谢谢Gopal。这对我行得通。 –