Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 10:58 AM
Dan Nash
Guest
 
Posts: n/a
Default auto redirect from diretory url

Hi

Subject line doesn't make sense I know. Basically we have a number of people
on our system. They can sign up automatically and create their page.

What I want to be able to do is give them their own url (eg.
www.mydomain.com/theirsite).

Because they can sign up without our interference, I need some way of
creating a directory, with an index page that goes to their site, or some
way of mydomain.com's index.asp reading the "/theirsite" and redirected to
wherever it needs to go (viewartist.asp?id=them). Is that possible or will
the web browser always try and go to a the "/theirsite" directory?

Thanks for your help!


Dan


  #2  
Old July 19th, 2005, 10:58 AM
Ray at
Guest
 
Posts: n/a
Default Re: auto redirect from diretory url

Use a custom 404 for this. http://www.aspfaq.com/show.asp?id=2162 Just be
sure to restrict any names of directories you use or may possibly want to
use in the future. Like, don't let someone create an account with "images"
as his name or something.

Ray at work

"Dan Nash" <dan-nospam@musoswire.co.uk> wrote in message
news:e5NLtOe1DHA.2460@TK2MSFTNGP10.phx.gbl...[color=blue]
> Hi
>
> Subject line doesn't make sense I know. Basically we have a number of[/color]
people[color=blue]
> on our system. They can sign up automatically and create their page.
>
> What I want to be able to do is give them their own url (eg.
> www.mydomain.com/theirsite).
>
> Because they can sign up without our interference, I need some way of
> creating a directory, with an index page that goes to their site, or some
> way of mydomain.com's index.asp reading the "/theirsite" and redirected to
> wherever it needs to go (viewartist.asp?id=them). Is that possible or will
> the web browser always try and go to a the "/theirsite" directory?
>
> Thanks for your help!
>
>
> Dan
>
>[/color]


  #3  
Old July 19th, 2005, 10:59 AM
Brynn
Guest
 
Posts: n/a
Default Re: auto redirect from diretory url


I have a similar project for users ...

I use ASP to create the directory, and copy a defualt.asp file of mine
into it ... the asp file goes something like ...

-- default.asp --

<%
Dim userName
userName = Replace(Replace(Request.ServerVariables("Script_Na me"),
"default.asp", ""), "/", "")


Response.Redirect("/viewartist.asp?userid=" & userName)
%>


OR BETTER YET ... ANOTHER PROJECT I HAVE WORKED ON

I just wrote the asp file upon user creation

<%
'// Code to create directory

'// Code to write a new asp file
%>

-- default.asp --

<%
Response.Redirect("/viewartist.asp?userid=123456")
%>


This second solution is better ... just when you create the user
account make sure that their name is not in the list of folders you
are using for site creation ... what I always do is just have all of
my folders start with an underscore ... and not allow any usernames to
start with an underscore ... with username validation this is a sinch
.... AND it keeps your folders alphabetically first for easy sorting.

just a thought ... I haven't tried using the 404 ... but would be
nervous doing so ... besides ... if they have images or anything ....
you can do what I did and create

/username/images/
/username/statictextdata/

Another thing I did ...
I kept all of their data in the database, but wrote other parts to
their statictextdata folder so the database wasn't being hit all the
time for viewing.

I almost ALWAYS do this for my advanced shopping systems. products are
ADDED, UPDATED, DELETED ... MUCH MUCH less than SELECTED

In my shopping systems I generally have all products in a database,
have it where they can be added to, updated, deleted through a UI ...
then have a button to "SEND CHANGES TO WEBSITE" ((althought
technically they are on a website .. their extranet.
Then, send changes writes over the products in a textdata/products/
folder ... usallly in the form of FULL pages of products html

Anyway ... too much info ... sorry






On Thu, 8 Jan 2004 12:32:20 -0000, "Dan Nash"
<dan-nospam@musoswire.co.uk> wrote:
[color=blue]
>Hi
>
>Subject line doesn't make sense I know. Basically we have a number of people
>on our system. They can sign up automatically and create their page.
>
>What I want to be able to do is give them their own url (eg.
>www.mydomain.com/theirsite).
>
>Because they can sign up without our interference, I need some way of
>creating a directory, with an index page that goes to their site, or some
>way of mydomain.com's index.asp reading the "/theirsite" and redirected to
>wherever it needs to go (viewartist.asp?id=them). Is that possible or will
>the web browser always try and go to a the "/theirsite" directory?
>
>Thanks for your help!
>
>
>Dan
>
>[/color]

  #4  
Old July 19th, 2005, 10:59 AM
Brynn
Guest
 
Posts: n/a
Default Re: auto redirect from diretory url

Although, the 404 redirect seems to be working fine for aspfaq.com I
may have to play with it.

But my way will work if you do not have access to manipulate the 404
... which some providers don't give (the bad evil ones )



On Thu, 08 Jan 2004 17:41:33 GMT, z@z.com (Brynn) wrote:
[color=blue]
>
>I have a similar project for users ...
>
>I use ASP to create the directory, and copy a defualt.asp file of mine
>into it ... the asp file goes something like ...
>
>-- default.asp --
>
><%
>Dim userName
>userName = Replace(Replace(Request.ServerVariables("Script_Na me"),
>"default.asp", ""), "/", "")
>
>
>Response.Redirect("/viewartist.asp?userid=" & userName)
>%>
>
>
>OR BETTER YET ... ANOTHER PROJECT I HAVE WORKED ON
>
>I just wrote the asp file upon user creation
>
><%
>'// Code to create directory
>
>'// Code to write a new asp file
>%>
>
>-- default.asp --
>
><%
>Response.Redirect("/viewartist.asp?userid=123456")
>%>
>
>
>This second solution is better ... just when you create the user
>account make sure that their name is not in the list of folders you
>are using for site creation ... what I always do is just have all of
>my folders start with an underscore ... and not allow any usernames to
>start with an underscore ... with username validation this is a sinch
>... AND it keeps your folders alphabetically first for easy sorting.
>
>just a thought ... I haven't tried using the 404 ... but would be
>nervous doing so ... besides ... if they have images or anything ....
>you can do what I did and create
>
>/username/images/
>/username/statictextdata/
>
>Another thing I did ...
>I kept all of their data in the database, but wrote other parts to
>their statictextdata folder so the database wasn't being hit all the
>time for viewing.
>
>I almost ALWAYS do this for my advanced shopping systems. products are
>ADDED, UPDATED, DELETED ... MUCH MUCH less than SELECTED
>
>In my shopping systems I generally have all products in a database,
>have it where they can be added to, updated, deleted through a UI ...
>then have a button to "SEND CHANGES TO WEBSITE" ((althought
>technically they are on a website .. their extranet.
>Then, send changes writes over the products in a textdata/products/
>folder ... usallly in the form of FULL pages of products html
>
>Anyway ... too much info ... sorry
>
>
>
>
>
>
>On Thu, 8 Jan 2004 12:32:20 -0000, "Dan Nash"
><dan-nospam@musoswire.co.uk> wrote:
>[color=green]
>>Hi
>>
>>Subject line doesn't make sense I know. Basically we have a number of people
>>on our system. They can sign up automatically and create their page.
>>
>>What I want to be able to do is give them their own url (eg.
>>www.mydomain.com/theirsite).
>>
>>Because they can sign up without our interference, I need some way of
>>creating a directory, with an index page that goes to their site, or some
>>way of mydomain.com's index.asp reading the "/theirsite" and redirected to
>>wherever it needs to go (viewartist.asp?id=them). Is that possible or will
>>the web browser always try and go to a the "/theirsite" directory?
>>
>>Thanks for your help!
>>
>>
>>Dan
>>
>>[/color]
>[/color]

  #5  
Old July 19th, 2005, 11:00 AM
Dan Nash
Guest
 
Posts: n/a
Default Re: auto redirect from diretory url

Hi Guys

Thanks a lot for your replies. Some interesting ideas...

I'm gonna have a go with the 404 idea first of all, for two reasons...

1) I do have 404 access (I think)

and 2) it would take me a whole day to rename all the directories with a "_"
in front. I will however do that by standard in all future websites, in case
I ever need to do something with directories!!

Thanks again, and I'll be back if I have any trouble!! :o)
"Dan Nash" <dan-nospam@musoswire.co.uk> wrote in message
news:e5NLtOe1DHA.2460@TK2MSFTNGP10.phx.gbl...[color=blue]
> Hi
>
> Subject line doesn't make sense I know. Basically we have a number of[/color]
people[color=blue]
> on our system. They can sign up automatically and create their page.
>
> What I want to be able to do is give them their own url (eg.
> www.mydomain.com/theirsite).
>
> Because they can sign up without our interference, I need some way of
> creating a directory, with an index page that goes to their site, or some
> way of mydomain.com's index.asp reading the "/theirsite" and redirected to
> wherever it needs to go (viewartist.asp?id=them). Is that possible or will
> the web browser always try and go to a the "/theirsite" directory?
>
> Thanks for your help!
>
>
> Dan
>
>[/color]


  #6  
Old July 19th, 2005, 11:00 AM
Steven Burn
Guest
 
Posts: n/a
Default Re: auto redirect from diretory url

Dan Nash <dan-nospam@musoswire.co.uk> wrote in message
news:eHTYBoq1DHA.3140@tk2msftngp13.phx.gbl...[color=blue]
> Hi Guys
>
> Thanks a lot for your replies. Some interesting ideas...
>
> I'm gonna have a go with the 404 idea first of all, for two reasons...
>
> 1) I do have 404 access (I think)
>
> and 2) it would take me a whole day to rename all the directories with a[/color]
"_"[color=blue]
> in front. I will however do that by standard in all future websites, in[/color]
case[color=blue]
> I ever need to do something with directories!![/color]
</snip>

Actually, it wouldn't take that long if you wrote a script to do it for you.

Pseudo code;

Dim FSO
Dim Fldr
Dim SubFldr

Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fldr = FSO.GetFolder(Server.MapPath("./")).SubFolders 'current
Folder

For Each SubFldr in Fldr
'whatever code you want to use (If/Then etc) to re-name them
'Something along the lines of the following should suffice
If Not Left(SubFldr.Name, 1) = "_" Then
SubFldr.Name = "_" & SubFldr.Name
End If
Next

Set FSO = Nothing
Set Fldr = Nothing
Set SubFldr = Nothing

I've not checked this as I don't have time right now, so you may want to
check it before running it.
--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles