rewrite url for videos with dynamic links
rewrite url for videos with dynamic links I have a video sharing website where users upload their videos and get a link for the video, here is an example of the video link: http://example.com/user/files/index.php?id=123&name=abc the Url I want is http://example.com/user/f/123/abc Id parameter is the identifier (id) of the video and the name is optional.If a user forgot to write the name parameter ,then the URL will be like this http://example.com/user/f/123 but it should still reach the destination . What should I put in my htaccess to achieve this? 1 Answer 1 Try this in your Root/.htaccess file Root/.htaccess RewriteEngine on RewriteBase / #if the Requested filename is not a directory RewriteCond %{REQUEST_FILENAME} !-d #if the Requested filename is not a file RewriteCond %{REQUEST_FILENAME} !-f #if above conditions are true then rewrite the url RewriteRule ^user/f/([0-9]+)/([a-zA-Z0-...