PHP

how to remove .php extension from url in php

remove .php extension from url in php

Just follow these steps

Open .htacess file and copy below code in .htacess file

RewriteEngine On

RewriteRule ^test?$ test.php

Here test is your page name
Now you can visit your page like abc.com/test

remove ?id from url in php

if your url is user.php?id=1
then just copy the below code in your htacess file
RewriteEngine On

RewriteRule ^user/([0-9]+) user.php?id=$1



RewriteRule ^test?$ test.php

RewriteRule ^user/([0-9]+) user.php?id=$1


RewriteRule ^shop/cat/([0-9a-zA-Z]+)/subcat/([0-9a-zA-Z]+) shop.php?cat=$1&subcat=$2




  That’s It. Now you see a magic in your url
Basant

Recent Posts

How to Add Auto Increment to a Column in PostgreSQL ?

Learn how to efficiently set up auto-increment columns in PostgreSQL with this step-by-step guide. From…

4 hours ago

How to get the value of selected radio button using jQuery

Just use below code and modified according to your need. Note: this is very useful…

3 months ago

AWS

Steps: AWS puttyubuntu sudo su apt update apt install apache2 service apache2 start service apache2…

8 months ago