Click to See Complete Forum and Search --> : how to fix this error?
raven80
01-08-2006, 08:27 PM
<?php
$URL=$_SERVER['PHP_SELF']."/".rand(100,999);
header("Location: $URL");
?>
I use this script to redirect to itself but I want the URL change, e.g: I run http://www.myweb.com/redirect.php and it will redirect to http://www.myweb.com/redirect.php/xxx , xxx is a number from 100-999. But this alert appear: "Redirection limit for this URL is exceeded. Unable to load the requested page. This may be caused by cookie that are blocked."
Help me to fix it. Thanks
NogDog
01-08-2006, 08:48 PM
It's not redirecting to itself, it's trying to redirect to a file or directory named "xxx" (whatever the number is) under a directory called "redirect.php". Is that really what you intended?
raven80
01-08-2006, 09:08 PM
I want this file redirect.php open it self but URL appear followed with /xxx ( like use press any key at this page http://24h.com.vn/blank.php)
I want this script can do the same as this page. Thanks
Huevoos
01-08-2006, 09:32 PM
That redirection is made with javascript
you could use the url escroto.php/659 if you specify in php.in (i guess) the slash as a variable something, I don't know how to explain, someone else should be able to do it
and I think that if it is redirecting to itself it will redirect again and again
raven80
01-08-2006, 10:30 PM
you mean I specify the slash as a variable in php.ini
I want it redirect once and stop.
Huevoos
01-08-2006, 11:21 PM
not as a variable, I don't know a lot of this, but I think you can specify it to act like the ? in the url like here showthread.php?t=90949 the leading symbol to pass variables
raven80
01-08-2006, 11:33 PM
yes, I'll try.
Any other way to make it ?
chazzy
01-08-2006, 11:43 PM
usually if you see something like:
showtopic.php?1235908
or
showtopic.php/124109581
those are usually done via mod_rewrite in apache (and similar url rewriters in IIS/WebLogic/Websphere/etc) so if that's the idea you were trying to mimic, you're approaching it from the wrong way, as its a server configuration issue
raven80
01-09-2006, 12:06 AM
so I must config in apache, right??
chickenland
01-09-2006, 09:11 AM
Have a look at these, they should help:
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
http://www.sitepoint.com/article/guide-url-rewriting