Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove sub directory and file extension

If I have site.com/page/about.php

How can I remove the sub directory and file extension?

Example: site.com/about

like image 684
Chris Burton Avatar asked Sep 10 '11 23:09

Chris Burton


Video Answer


1 Answers

Use this in your .htaccess file

Options +FollowSymLinks
RewriteEngine On 
RewriteRule ^about(\/?)$ /page/about.php [NC,L]

Create your .htaccess in your root folder.

like image 155
Book Of Zeus Avatar answered Oct 03 '22 20:10

Book Of Zeus