• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

How to pass variables in a clean seo string for asp pages

I am stuck with ASP for a variety of reasons.
I have a need to use clean urls's for my pages like

www.mysite.com/products/support
www.mysite.com/products/tripods

things of this nature, right now my strings passed look like so:

www.mysite.com/products/support.asp
www.mysite.com/products/products.asp?cat=5&subcat=2&prod=4587

is there a way to clean up the URLs?
How could I still pass the information along?

I know I can set a default document for the first example but I want to be able to get to other pages in that particular directory the same way.
0
EGormly
Asked:
EGormly
  • 3
  • 3
  • 2
1 Solution
 
G_HCommented:
OK, the real question here is which IIS are you using?

If you are using IIS7 then this is going to be easy, otherwise quite a bit harder...

Can you please let us know.

GH
0
 
EGormlyAuthor Commented:
II6  :(
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
you'll need a url rewriter that can turn seo-friendly url's into usable url's for your application. Have a look at www.isapirewrite.com, I've used them a lot before and have had no complaints.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
G_HCommented:
There are two ways, "404" and "helicon"

I prefer IIS7, then 404 then Helicon (but that's just me)

OK, you are going to need to setup a custom 404 page, which will make a decision, based on the requested URL.

Setup IIS to "Execute" "/404.asp" when a page is not found.

In your 404.asp file you will need to breakdown the URL that was previously collected. To see what is going on put this in your 404.asp:
 
response.write Request.QueryString

Open in new window

This should show you what is sent over. Should be something like 404;http://www.mysite.com/products/products.asp?cat=5&subcat=2&prod=4587 (From my not-very-good memory).

You can then analise this string, and show what ever you like...

GH
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
@G_H

won't that hurt your seo rankings though? If google goes to your page and gets a 404 upon crawling it, its never going to see the custom page as the server returned the 404 code back to the crawler before the custom error page id displayed....
0
 
EGormlyAuthor Commented:
I do not care about SEO rankings, I only care that it conforms to our new designers requests.

I already do that with 404, I totally thin't think of using it for everything..

thanks
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
then why create SEO friendly URL's?

I would think twice about using this technique, not only is it a poor technique seo-wise, but its also poor site structure. Do you really want to be adding code everytime you have a new querystring parameter to account for?

just my .02 cents...
0
 
G_HCommented:
@The Big Daddy:

That depends on what you do next. Providing you follow this up with:

 
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", DestinationURL

Open in new window


... everything is fine. But I wanted to see how much help the asked needed, before IU went there... :-)

GH
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now