Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make .php extension not appear on website? [duplicate]

Tags:

php

I am using PHP for my website, and .php is appearing in my URLs. How can I remove this?

like image 694
Suraj Avatar asked Dec 26 '22 03:12

Suraj


1 Answers

There are lots of ways you could achieve this, but they depend largely on your choice of web server.

If, for instance, you were using Apache HTTPD you could use:

  • MultiViews or
  • AddHandler (e.g. inside Files or FilesMatch) or
  • Alias or
  • mod_rewrite

… other options are probably available, but those are the ones that spring to mind.

like image 161
Quentin Avatar answered Jan 05 '23 01:01

Quentin