TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   htaccess securing url (http://www.talkphp.com/general/2015-htaccess-securing-url.html)

sarmenhb 01-19-2008 07:02 PM

htaccess securing url
 
hi, im trying to build something like

_http://www.filecrunch.com

one question i do have is when i upload a file to filecrunch then try to download it the url becomes something like this:

_http://www.filecrunch.com/file/~wlrnof

how would i create something like this? so far i have in my interface is the upload field and when the file is uploaded it goes to a some directory that i've specified in php.ini

if there is a book i can purchase i would get it lol. but any help would be great.

thanks from the middle of my heart.

xenon 01-19-2008 09:04 PM

The name for the file is randomly generated after you upload it, and that link represents nothing but a truncation of a real file path. You can do that easily by writing a little htaccess file:

Code:

RewriteEngine On

RewriteRule ^~([a-zA-Z0-9])$ /some/path/on/server/script.php?process=$1

...for example. Get your script to work correctly first, and after that you take care of the urls. But to make it easier, don't hard code them (the urls).

ReSpawN 01-19-2008 09:49 PM

Wildhoney (or any other administrator) has done the same thing.

1: Get the category it's posted in :: General
2: Get the ID of the post :: 2015
3: Get the title of the thread :: htaccess securing url
Everything is dynamically fetched from the database and rewritten by the .htaccess. Guessing this is what you want to do, you can search the web for some awesome RegEx for .htaccess or create your own.

The basics: Make Dynamic URLs Search Engine Friendly

Good luck.


All times are GMT. The time now is 02:59 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0