Damodaran
Damodaran

Reputation: 11065

Url rewriting- Hide the folder structure

Now my site url is somthing like this

http://mydomain.com/MainFolder/user/login.php

http://mydomain.com/MainFolder/reports/dashboard.php

I need to hide the folder structure from the URL.

So the url will look like

http://mydomain.com/login.php

http://mydomain.com/dashboard.php

Thanks in advance....

Upvotes: 0

Views: 1045

Answers (1)

thedom
thedom

Reputation: 2518

Save that into .htaccess in your root web folder:

RewriteEngine On
RewriteRule login.php$ MainFolder/user/login.php
RewriteRule dashboard.php$ MainFolder/reports/dashboard.php

I don't know how many users you have - but this won't perform that good, because everytime someone accesses your site, the .htaccess file has to be read again. It would be better to include that in the vhost.conf (if possible!)...

Upvotes: 1

Related Questions