How can rewrite url using htaccess when add custom foulder name in url

懵懂的女人 提交于 2019-12-08 11:16:42

问题


I want to rewrite my URL using htaccss .I am working project in laravel 4 .I need to add following names with url.but its showing error.

The names are like , admin,government,bus,school

My current site url is :http://localhost/myproject/

But i want to access url following like,

1)http://localhost/myproject/admin

2)http://localhost/myproject/government

3)http://localhost/myproject/bus

4)http://localhost/myproject/school

This is my current .httacess code,

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

How can i add change to .htaccess file to access above urls.

来源:https://stackoverflow.com/questions/29140941/how-can-rewrite-url-using-htaccess-when-add-custom-foulder-name-in-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!