Home I'm trying to hide php extension in Ubuntu 16.04 apache
Reply: 1

I'm trying to hide php extension in Ubuntu 16.04 apache

gokul kandasamy
1#
gokul kandasamy Published in 2018-02-09 11:11:55Z

In server and i created a file named as .htaccess in /var/www/html and then i added the following lines in that

 `Options +FollowSymLinks`
 `RewriteEngine On`
 `RewriteCond %{REQUEST_FILENAME} !-d`
 `RewriteCond %{REQUEST_FILENAME} !-f`
 `RewriteRule ^ index.php [L]`

and enabled mod_rewrite module

sudo a2enmod rewrite

then restarted the service

sudo service apache2 restart

but also it is not working anyone help me with this

saiibitta
2#
saiibitta Reply to 2018-02-09 11:32:08Z

I think this code helps you

RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.php$ /$1 [R,L]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ /$1.php [NC,END]
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.35178 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO