-1

Hello guys i have browser url like this

www.test.com/?category=3D&page=0

I want to make this url like

www.test.com/category/3D/0

in core php but when i make this like that so how to retrieve the value 3D and o from url. help mi please !

Thanks in advance !

rahul tripathi
  • 321
  • 2
  • 7
  • 18

2 Answers2

1

You can use Apache mod_rewrite to achive this. In your case the following .htaccess RewriteRule would do the job. For a better overview, see this page

RewriteEngine on
RewriteRule ^/category/([A-Z0-9]+)/([0-9]+) /index.php?category=$1&page=$2
Philipp
  • 15,377
  • 4
  • 35
  • 52
0

You need to set url rewriting using htaccess file, and then you can access your variables like $_GET['category'] even though url will be like www.test.com/category/3D/0

Marko D
  • 7,576
  • 2
  • 26
  • 38