Forum Moderators: phranque

Message Too Old, No Replies

htaccess and random number-string?

Help me generate a random string to work with htaccess

         

explorador

3:36 pm on Aug 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi, I need to set up my htaccess so it rewrites the URL adding a random string to it, example:

http:// www. mydomain .com / widgets / about.htm
http:// www. mydomain .com / widgets / about.htm ? Sj3291

It could be a number, string, both or even some sort of timestamp

Why? I'm having huge pressure with this: Stats on GA messed up [http://www.webmasterworld.com/analytics/4347835.htm]

But I can't fix it whatever the problem could be. I can't access the server in a way that I can diagnose it or fix it. We had problems like this in the past but the burocracy makes it impossible to deal with it, specially when the admins are not sure how to set up some things on the server (and I don't have a vote on that no matter what). Hope you understand my limitations.

So I suspect there is a problem with proxies and cache, my idea is to solve it makin EACH PAGE CALL unique, so it will always be requested and server as such. I could do this with JS adding an URL check and if no extra data is on it then I would add it via self redirect, but I hope to get this via htaccess instead to avoid page flashing on the client.

Thanks in advance.

PS. Please understand, things the way they are here I could ask them if there is a cache thing running and they say no, then yes, then I don't know! and even if I ask them to turn it off it is a long way and many times a plain dead end.

g1smd

3:48 pm on Aug 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If the site uses scripts, such as PHP, the easiest way to see if there is a cache running is to temporarily add a date/time stamp to the page output. You can do this as a hidden comment or as plain text.

Request the page from several different browsers a few seconds apart. If the timestamp is the same you're looking at cached pages.

Alternatively get the page to echo back the browser User-agent string. You'll soon see if you're looking at a page that someone else has already viewed and you're now therefore seeing the cached copy.

explorador

3:54 pm on Aug 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks, only the CMS admin part is on PERL and PHP, the rest is pure and plain HTML. I could add a time stamp to it, but I think the cache would work as usual, showing me the latest page when I update it, not knowing if in fact there is a cache thing running between.