-2

I am creating a web page using php. Where i created a clean url by htaccess

techoming.com/videos

Now i want to add a get variable such as

techoming.com/videos?cat=fun

Please help me here

Faizan Amin
  • 398
  • 5
  • 16
  • Please provide a [mcve] or samples of the code that you have attempted – happymacarts Dec 15 '16 at 18:00
  • what you need to look into is `$_GET`. please do some research before asking. or maybe even read the manual, as that will get you even further than you think. –  Dec 15 '16 at 19:14

1 Answers1

0

Here's a basic way to make that work: add this to your htaccess.

RewriteEngine on
RewriteRule ^videos/([A-Za-z0-9_-]*)$ /videos.php?cat=$1 [L]

Users will see http://www.website.com/videos/fun but your server will process that link as http://www.website.com/videos?cat=fun

Chris Wesson
  • 299
  • 1
  • 4