Forum Moderators: coopster

Message Too Old, No Replies

Redirecting from directories?

         

az_paz

2:06 pm on Apr 1, 2005 (gmt 0)



Does anybody know if it is possible to redirect users automatically from subdirectories of a website?

ie. when a visitor views www.mysite.com/user125/ i want the visitor to be redirected to a different page, say www.mysite.com/index.php?user=125.

i would use .htaccess but my server is running ISS and i've been told it doesn't support .htaccess (i have given it a quick try as well).

i can't just use a php or meta redirect because i want each user to think they have their own subdirectory, and there may be a large number of users. is the only way to do this to create a directory in my site, containing a index.php file to redirect them, for each user on registration?

any helps would be gratefully received.

dreamcatcher

8:17 pm on Apr 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi az_paz, welcome to WebmasterWorld. :)

Could you not put a index.php file in each directory and use a meta refresh based on the value of the dir name?

So, in the 'user125' dir have:

<html>
<head>
<title>Redirecting...</title>
<meta http-equiv="refresh" content="0;URL=http://yoursite.com/index.php?user=125">
</head>

<body>
</body>
</html>

dc

dreamcatcher

8:20 pm on Apr 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oops, just re-read your post. Guess that won`t work. Sorry.

jatar_k

11:48 pm on Apr 1, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> is the only way to do this to create a directory in my site, containing a index.php file to redirect them

well, that is the option if you can't get rewrite, there is a rewrite for IIS I believe it is called ISAPI Rewrite [google.com]