sharma-pankaj-tech / phurl

Automatically exported from code.google.com/p/phurl
0 stars 0 forks source link

Password protect the Index page #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
How can I password project the past for posting new URL but still keep it
open to that people I give the shortened URLs to can work with them?

Original issue reported on code.google.com by sha...@gmail.com on 24 Oct 2009 at 5:03

GoogleCodeExporter commented 9 years ago
s/past/page/

Original comment by sha...@gmail.com on 25 Oct 2009 at 2:55

GoogleCodeExporter commented 9 years ago
Better stating the feature request:
- include an option to make the shortner for private use only, so that only the
registered users can shorten urls, and everyone else can only access the short 
version.

For the moment, I have hacked the script to be for private use only by taking 
these
steps:

1. Modified .htaccess to: RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?alias=$1 [L]
2. Renamed index.php to secret.php
3. Added at the begining of redirect.php:
if (empty($_GET['alias'])) {
header("Location: http://www.myprefferedsite.com", true, 301);
exit();
}
4. Renamed redirect.php to index.php

Now anyone trying to access the shortner without parameters or with a 
non-existent
short url gets redirected to myprefferedsite.com. I can access the shortner by
directly pointing the browser to secret.php

However, this is only security by obscurity and a hack, whereas security by 
design
would be preffered.

Original comment by gabriel....@gmail.com on 26 Oct 2009 at 11:48

GoogleCodeExporter commented 9 years ago

Original comment by hdo...@gmail.com on 19 Mar 2010 at 4:29

GoogleCodeExporter commented 9 years ago
Issue 38 has been merged into this issue.

Original comment by hdo...@gmail.com on 19 Mar 2010 at 4:30