How to prevent duplicating webpage?

  • Thread starter Thread starter JohnC
  • Start date Start date
J

JohnC

I have a webapp that allows users to delete/add content on a webpage.
The webpage is accessed like this:

www.abc.com/app/user1/
www.abc.com/app/user2/

where index.aspx is the default page. To do the above though requires
creating a new user subfolder, copying the index.aspx page from the app
folder and renaming it. This can be problematic when I need to update
templates.

www.abc.com/app/usertemplate.aspx //this page is copied and renamed to
for each user.

How can I do the above without creating new directories then copying
and renaming the template file? For example, if someone type in

www.abc.com/app/user1

The default index.aspx page in the app folder would take in the
parameter "user1", look it up in the database and then display the
webpage as above if the name is found.

Thanks,
john
 
Assuming you are using ASP.Net 2.0, why don't you use a Master Page and
store the content page in the database. So if the user changes, simply fetch
the HTML for the appropriate user from the database.

HTH.

--
With Regards
Shailen Sukul
..Net Architect
(MCPD: Ent Apps, MCSD.Net MCSD MCAD)
Ashlen Consulting Services
http://www.ashlen.net.au
 
Shailen said:
Assuming you are using ASP.Net 2.0, why don't you use a Master Page and
store the content page in the database. So if the user changes, simply fetch
the HTML for the appropriate user from the database.

Thanks. That will work but the URL will still look like this:

www.abc.com/app

How can I get it to look like this without creating subfolders:

www.abc.com/app/user1
 
hmm.. might have to look into custom HttpHandlers for that one.

Just a side suggestion... you could register a DNS domain and redirect
users to a url with a query string and hide it using cloaking, like so:

user1.abc.com --redirects to--> abc.com?userid=user1
and use cloaking to hide abc.com?userid=user1

HTH

--
With Regards
Shailen Sukul
..Net Architect
(MCPD: Ent Apps, MCSD.Net MCSD MCAD)
Ashlen Consulting Services
http://www.ashlen.net.au
 
I know a subdomain can be setup manually but I need to do it
programmatically. I'm checking with my hosting service if that can be
done.

Howevever, I still need to display a webpage as a folder structure in
the URL. I'd like people to type in one of the addresses below,
instead of a webpage, and the particular page displays. What I'd like
is on the left and the actual page path is on the right:

user1.abc.com/ -> user1.abc.com/index.aspx
user1.abc.com/site2 -> user1.abc.com/site2.aspx
user1.abc.com/site3 -> user1.abc.com/site3.aspx

Thanks,
john
 
Back
Top