How can rewrite url using htaccess when add custom

2019-06-14 03:07发布

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.

0条回答
登录 后发表回答