Forum Moderators: open

Message Too Old, No Replies

Writing URL without .asp extension?

how to write url as?Bandname=RockGods

         

KRMwebdesign

10:37 am on Oct 8, 2009 (gmt 0)

10+ Year Member



Hi there,
I'm building a website with a number of microsites on it. For the sake of making it easy for users to find their websites or for others to find them I want users to be able to find their websites by typing the URL as http://www.example.com/?Bandname=RockGods

I've searched on the web and I can't find anywhere that tells me how to do this.

Do I have to add an include within the page? Is it something to do with the microsites coming off the main index page?

Any help would be appreciated.
Thanks.

[edited by: marcel at 11:24 am (utc) on Oct. 8, 2009]
[edit reason] examplified url [/edit]

marcel

11:31 am on Oct 8, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you want to redirect the user to a new URL or do you want to show the correct microsite with the given URL?

How are you showing the different microsites currently?

Basically you can query the QueryString from the default.asp page, ie.

http://www.example.com/?Bandname=RockGods
is exactly the same as
http://www.example.com/default.asp?Bandname=RockGods

*Edit: Of course, this depends on your default document being default.asp, if you have index.asp as your default document use this instead :)

KRMwebdesign

2:12 pm on Oct 8, 2009 (gmt 0)

10+ Year Member



Hi Marcel,
Thanks for getting back to me. I want to show the correct microsite with the given URL.

At the moment I am showing the microsites through these URLs:
http://www.example.com/bands.asp?BandID=5

Does this mean that I could query the querystring from the bands page but not type it straight into the browser address bar?

http://www.example.com/?Bandname=RockGods

marcel

2:30 pm on Oct 8, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I want to show the correct microsite with the given URL.

If that's the case I would rename bands.asp to default.asp and query the database for the band name instead of the BandID.

If the record set is empty you can then show a generic page or return a 404 page.

marcel

2:51 pm on Oct 8, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would also recommend using URL rewriting with (for example) ISAPI_Rewrite to make the URLs even more user friendly, ie.

http://www.example.com/RockGods/
http://www.example.com/GuitarHeros/

etc.

KRMwebdesign

11:55 am on Oct 9, 2009 (gmt 0)

10+ Year Member




Thanks for this info. I was rewriting my URLs manually for my last website lol. I knew there was some sort of editing tool but didn't know what it was.

Only problem is I don't have IIS which is odd for an ASP developer. I'm using XP home. I may install apache and try use it that way.

Cheers for the help.