Re: [PHP] APACHE MOD_REWRITE
On 10/31/07, Alberto García Gómez <[EMAIL PROTECTED]> wrote: > I have this URL > > http://www.myserver.com/dir1/dir2/page.html > > and I wish to rewrite the url using mod_rewrite to add a ~ after the first > dir always, eg.: > > http://www.myserver.com/~dir1/dir2/page.html > > Please it's very important to make this ASAP Then it's very important to ask the question on the right list ASAP. Apache mailing lists: http://httpd.apache.org/lists.html -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] APACHE MOD_REWRITE
I have this URL http://www.myserver.com/dir1/dir2/page.html and I wish to rewrite the url using mod_rewrite to add a ~ after the first dir always, eg.: http://www.myserver.com/~dir1/dir2/page.html Please it's very important to make this ASAP best regards Este correo ha sido enviado desde el Politécnico de Informática "Carlos Marx" de Matanzas. "La gran batalla se librará en el campo de las ideas" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache/mod_rewrite for User Tracking
> I'm not sure how off-topic this may be, but I'll carry on anyway... 'Sokay, I'll force it back on-topic :-) > sent back to the page. Before now, I have cookies and IP address for user > tracking. If someone could accept a cookie (I used a self-referring script to Use PHP4's builtin session support. Save your hair. It will use cookies for users that accept cookies, and munge your URLs and FORMs automagically for users that don't accept cookies. > With IP addresses, you can't record return visits, so it just tracks one visit. > With some ISP's they seam to use variying IP addresses, so then each page Yes. Large ISPs shuffle client IP's addresses regularly. Also, users behind firewalls/proxies will be sharing a single IP. You don't want to use IP for user identification. It doesn't work. It's also spoofable by hackers, or so the experts tell me. > What I would like to do now is track the user with the URL. When someone calls > the site, (ether through the front door, or sent back to get an ID), they are > given an ID like so: 'KjsiHdbEyu8G645Dus96Sy54GD'. They are then sent to say, > http://localhost/KjsiHdbEyu8G645Dus96Sy54GD/home. > > Using mod_rewrite, I can then get the tracking var (KjsiHdbEyu8G645Dus96Sy54GD), > and rewrite the URL to http://localhost/home, and call the script. I know this > is possible. Something like /^\/([a-zA-Z0-9]{80})\/(.*)/$1?$2/ could work for > the rewrite rule, but rather than use $HTTP_SERVER_VARS["QUERY_STRING"] to get > the var, as I use a GET vars for some functions, could I get a var which is sent > to Apache, and then PHP accesses the var from there, and the rest is as normal? Use http://localhost/home/KjsiHdbEyu8G645Dus96Sy54GD/ instead. (IE, swap the userid/file to file/userid) Throw in "home", and you'll see at least one variable you can tear apart with Regex (or explode, even easier) to get the userid. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Apache/mod_rewrite for User Tracking
I'm not sure how off-topic this may be, but I'll carry on anyway... I wan't to create a user tracking system on the web site, that I can use in PHP. I've had a look at mod_rewrite, and would like to implemet something like the following: I have a few scripts, say 'home', 'search', 'help', etc. and all are force mapped onto PHP 4. If someone calls this scripts (without entering the site through the front door), then they are sent back, set a user tracking value, and sent back to the page. Before now, I have cookies and IP address for user tracking. If someone could accept a cookie (I used a self-referring script to check) then they are given a cookie, and they can be tracked. They can also be tracked over many visits with a cookie. If they don't then I make a note of their IP address, and their address is used. With IP addresses, you can't record return visits, so it just tracks one visit. With some ISP's they seam to use variying IP addresses, so then each page checked for a valid user, they didn't find one, and forwarded then back to 'index' to set a user session, and come back. But they seamed (to the server/PHP) to have different IP's over these steps, and the visitor was locked into a HTTP Redirect cycle (until the broswer stop with a fail). What I would like to do now is track the user with the URL. When someone calls the site, (ether through the front door, or sent back to get an ID), they are given an ID like so: 'KjsiHdbEyu8G645Dus96Sy54GD'. They are then sent to say, http://localhost/KjsiHdbEyu8G645Dus96Sy54GD/home. Using mod_rewrite, I can then get the tracking var (KjsiHdbEyu8G645Dus96Sy54GD), and rewrite the URL to http://localhost/home, and call the script. I know this is possible. Something like /^\/([a-zA-Z0-9]{80})\/(.*)/$1?$2/ could work for the rewrite rule, but rather than use $HTTP_SERVER_VARS["QUERY_STRING"] to get the var, as I use a GET vars for some functions, could I get a var which is sent to Apache, and then PHP accesses the var from there, and the rest is as normal? That's what I would prefer to do, but I'm not sure if it's possible (and explained it well enough). If I had to do something like /^\/([a-zA-Z0-9]{80})\/(.*)/$1?$2/ I would just have to develop to that instead. Failing that, any suggestions? Thanks in advance.. Jonathan Wright.. Webmaster http://www.kjtoombs.co.uk/ (http://www.kjtoombs.co.uk/home) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]