开发者

how to fix url with htacces

I have a url which initially h开发者_Python百科ttp://web.com/index.php/home/funct/ and I want to change this by removing the index.php so that it becomes http://web.com/home/funct/


If you are using Apache server, create a file called .htaccess and put this in it:

<IfModule mod_rewrite.c>
    RewriteEngine on

    # If the file/dir is NOT real go to index
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

Then just remove the reference to "/index.php/" from your links and when the server doesn't find "home/funct" it will go looking for "/index.php/home/funct".

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜