Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropbox style URL, without using hashes or params

Could someone point me in the right direction? I'm trying to create a url like the one below. I don't want to use url hashes #I2QT40oSwU0AoH7g02cAHI or parameters ?myparam=I2QT40oSwU0AoH7g02cAHI.

https://www.dropbox.com/l/I2QT40oSwU0AoH7g02cAHI

Is this done with mod_rewrite?

Many thanks!

like image 810
DeFeNdog Avatar asked Oct 02 '22 20:10

DeFeNdog


2 Answers

Yes, it's done by editing the httpd.conf file (turn on AllowOverride all) and creating a .htaccess file in your root web directory.

Here is a sample .htaccess file

Options -Multiviews

RewriteEngine On
RewriteBase /

RewriteRule ^l/(.*)$ /somescript.php?key=$1 [L]

The above will direct

https://www.dropbox.com/l/I2QT40oSwU0AoH7g02cAHI

to

https://www.dropbox.com/somescript.php?key=I2QT40oSwU0AoH7g02cAHI
like image 98
Lloyd Banks Avatar answered Oct 09 '22 00:10

Lloyd Banks


It's called Clean URL Usually it's implemented via url rewrite technique. But also you can use 404 HTTP error page to handle such urls.

like image 35
Eduard Avatar answered Oct 09 '22 01:10

Eduard