Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirects making ugly folders

Status
Not open for further replies.

timtom

Programmer
Jul 12, 2001
78
GB
I've just finished creating a lovely new dynamic database driven website. It's all small as I've got the amount of folders and images, asp files etc. down to an absolute minimum and it's all very neat and feng shui and so I'm very pleased with it.

However, boss has just said he wants a ton of redirects to make marketing material easier on the eye.

Thus far, in order to do the and that he wants, I've had to create lots of folders inside my tidy web folder - each containing only a simple default.asp page redirecting to the actual content page based on the correct querystring. Ugh! I know it might seem like I'm complaining about nothing but I'm quite slow, and I need a bit of order in my life. Is there another way of doing these simple redirects WITHOUT having real folders of the same name as the redirect? Does anyone have any ideas? I have total control over the web server.

Thanks very much
Sarah
User_timtom.jpg
[sub]WASN'T FIT ENOUGH FOR THE POLICE FORCE[/sub]​
 
I don't understand your question.
Basically we want visitors to get to a page on the site say, about cars (which might be as complicated as for example) by simply typing in
What I object to is having a folder in my website called 'CARS'. Is there another way of redirecting from this type of simplified URL having to set up loads of folders?
User_timtom.jpg
[sub]WASN'T FIT ENOUGH FOR THE POLICE FORCE[/sub]​
 
timtom,

The reason why I asked is because the answer can depend on how you want it set up to redirect without having folders.

You could set it up so that it is a parameter passed to an ASP page

fengshui_1998
 
No. As I said, my boss wants to use - and has indeed already printed marketing material featuring - the format.
User_timtom.jpg
[sub]WASN'T FIT ENOUGH FOR THE POLICE FORCE[/sub]​
 
What about the cars folder having just a default document (asp page) that redirects to your code.

You could implement a case statement, to show information based on the redirect.

So /cars would have one file in it, say 'default.asp'.
Within default.asp, you redirect to ' or whatever. The user types in ' and unknowingly is redirected within your code.

Within your code, you could use a select statement to determine where the person is "coming" from using the redir_id variable, and push your db info back to the user.

Would this suffice?
 
desktop, that's what I've been doing! The only problem is that I don't want loads of folders in my website. They aren't pertinent to my code and they confuse me. If the website functions with five asp pages and one images folder and one javascript folder tied to a database on a different server - then that's how I want it to be. Call me old-fashioned but it doesn't seem right somehow that the marketing department get to control the files and folders on the web server.

Thanks anyway.
User_timtom.jpg
[sub]WASN'T FIT ENOUGH FOR THE POLICE FORCE[/sub]​
 
timtom,

If I understand this correctly, since your boss has materiel that points to ' you basically want to capture the URL and redirect it to another ASP page because you don't want to have that URL and folder exist in your web directory. Correct?

I'm not sure you can do that with ASP, but you can with .NET. Just came back from a .NET conference and you can intercept the URL coming into your site and edit the string. Just trying to help.

fengshui_1998
 
Just throwing some idea :)

What about creating a virtual directory for each folder you want?
ex:
In IIS, create a virtual directory with the alias "cars" which redirect to your root web folder. Create another one with the alias "money" that also redirect to the root folder.

Then, in your default.asp page in your root, just check with a server variables where the user is coming from, if it's "cars" then you can redirect the user to cars.asp, if it's "money" then money.asp or whatever page you want.

So when a visitor call or he will always end up in your default.asp page on your root directory without having a physical folder for each name.

Don't know if that's what you're looking for...

Hope this help,
Martin
 
timtom ,

Map the 404 - File not found error to an ASP file , in the custom errors tab of your web site in IIS, whcih can redirect to the corresponding page. In this way you dont need to have any directory structure.

SomulaV

 
Along the same lines as the virtual directories idea...
Create 1 folder and name it something that will be memorable. Make that a virtual directory and put all the folders your boss could ever want inside it. Than create a simple redirect (using Server.transfer to keep form info) back to the default directory. It will be a mess, but it will be nicely packaged as one additional folder in directory to never be played with ever again.
-Tarwn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top