> PHP - Variable in the URL?

PHP - Variable in the URL?

Posted at: 2014-12-18 
That is done with a "URL Rewrite".

You create a .htaccess file in the root directory of the web site.

.htaccess is commonly used to restrict users from directly accessing parts of the site or file types that only the web server or your scripts should be able to use, but you can also include other commands.

A rewrite rules breaks up the URL from the web browser and reformats it to an easier-to-parse one for the php (or an language) scripts to handle.

See below for more info:

https://www.addedbytes.com/articles/for-...

In php you can pass variable through the url by using something like this:

http://somesite.com/video/v=768994433

But I see some sites use something like

http://somesite.com/video/768994433

I know how to retrieve variable from the first type but how would I with the other?

How would you set this up?