2013-10-10 51 views
1

我使用的下车学习视频错误重新写入规则

重写规则,但它不能正常工作

Options +FollowSymLinks 
Options -Indexes 

DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

我想它捡起如果只需键入 http://www.example.com/hmvctest/helloworld

,但如果我在 http://www.example.com/hmvctest/index.php/helloworld

键入它仅适用目前只显示“无输入文件指定”我用笨和的cPanel我曾尝试下面的两个答案,仍然没有运气我的网站使用HTTPS

回答

1

尝试用这个替换您的规则:

Options +FollowSymLinks -Indexes -MultiViews 

DirectoryIndex index.php 

RewriteEngine on 

RewriteCond %{REQUEST_URI} !^/(index\.php|images/|robots\.txt) [NC] 
RewriteRule^index.php%{REQUEST_URI} [L] 
+0

我得到它的工作我用了一个不同的现在也让我有https也是什么后 – user2814461

0
Use this code 
<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /www.example.com 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

<IfModule !mod_rewrite.c> 
    ErrorDocument 404 /index.php 
</IfModule> 
+0

还是不会改变的例子后工作.com到我的域名我有mysql和apache – user2814461