Welcome Guest, Not a member yet? Register   Sign In
Routes and hashed URLs
#5

(11-22-2017, 08:18 AM)wirikidor Wrote:
(11-22-2017, 04:32 AM)InsiteFX Wrote: You should read this article.

The Comprehensive Guide to URL Parameter Encryption in PHP

You seem to think I'm trying to encrypt or hide something in this URL string and I'm not.  The fact is I'm hashing to make a large number like 405004200 into a smaller set like 6mqv4mi to make the URL smaller.

It is unknown how hashing would help you with that though ... Your large number example is certainly smaller than the output size of any reliable hashing function, so I would question if you are indeed "hashing" something or not.

If you are, then the provided article link has some very good advice (despite its title; it actually tells you not to encrypt) and if you aren't then chances are you're doing something wrong (as using the wrong terms to call things is a big sign of that).

The most effective way to shorten a number is to simply convert it to a higher base system, which PHP has a very convenient tool for:

Code:
php > var_dump(base_convert('405004200', 10 /* from base 10 */, 36 /* to base 36; the maximum allowed by this function*/));
php shell code:1:
string(6) "6p4n8o"

Anyway, on topic:

The .htaccess file either works or it doesn't - showing it doesn't give us an idea of what you're trying to accomplish, and you've shown very little detail of what you've tried to do with routes. If you give us an example of which URL should trigger which controller/function, it would be much easier for anyone to help you.

Also, you say 404 but it is unclear whether that's a standard Apache/nginx 404 error page or a CI-styled one? If it is the former, then your .htaccess doesn't work.
Reply


Messages In This Thread
Routes and hashed URLs - by wirikidor - 11-21-2017, 05:11 PM
RE: Routes and hashed URLs - by InsiteFX - 11-22-2017, 04:32 AM
RE: Routes and hashed URLs - by wirikidor - 11-22-2017, 08:18 AM
RE: Routes and hashed URLs - by Narf - 11-22-2017, 09:23 AM
RE: Routes and hashed URLs - by wirikidor - 11-22-2017, 09:59 AM
RE: Routes and hashed URLs - by jreklund - 11-22-2017, 05:24 AM
RE: Routes and hashed URLs - by wirikidor - 11-23-2017, 04:02 PM
RE: Routes and hashed URLs - by Narf - 11-22-2017, 11:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB