SEO friendly URL in Classic ASP? - asp-classic

I have website developed in classic ASP. The URL is not SEO friendly at present.
Please suggest how I can make the SEO friendly URL for my website in ASP.
Is there any supporting functions which can help in creating SEO friendly URL in ASP?
URL for product Information page like this :
http://www.yourdomain.com/store/template/template2/Default.asp?mainpage=product_info&P_ID=18047
Thanks for your help.
I have read the documentation and Installed the IIRF properly.Now i have few queries.I tried few sample with redirection and they are wrking.I put the clean URL in address bar and result shows data from the original URL.
My Problems: I am still bit confused abt the rewrite and redirect.I don't expect you to teach and guide me for the same.Please pardon me if i write confusing sometime.Please feel free to guide me if i am wrong in approach for SEO friendly URL's.
My Goal is to create SEO friendly URL's for my shopping cart.what I want when page gets parsed in browser it should show the Parsed links as SEO friendly not the original one.
As in my sample when i type URL in address bar it didn't gets changed to clean URL. When i type the clean URL in address bar it shows the data from original URL.
In my shopping cart there are lot of Hyperlinks to other pages.They are also in Dynamic in nature not the static one.How can i set those static hyperlinks to clean URL using IIRF without making substantial changes in my cart.
regards,
Sunny

Configure IIS to do URL Rewriting. Microsoft has an addon for IIS7 (Vista, Server 2008), but you can install IIRF (open source) in IIS5.1 (XP) and IIS6 (Server 2003).
Let all incoming requests or any path starting with /media/ (or pick your own) go through un-rewritten. Only put static files in there such as CSS/JavaScript/images.
Rewrite all incoming request URLS from, e.g., /foo/bar?abc=xyz to /index.asp/foo/bar?abc=xyz. The rewriting is all internal to IIS so the end-user does not see any URL rewriting.
Within index.asp, you can access the original incoming URL /foo/bar via
<%= Request.ServerVariables("SCRIPT_NAME") %>
<%= Request.ServerVariables("PATH_INFO") %>
<%= Request.ServerVariables("QUERY_STRING") %>
yielding
/index.asp
/foo/bar
abc=xyz

We have used isapi rewrite before and it works very well, very configurable per site etc
http://www.isapirewrite.com/

Related

URL redirecting in classic asp

My application url is like this.
http://somename/webname/default.asp
It also contains some other default.asp like http://somename/webname/booking/default.asp and some others too. Even if user tries to access other default.asp, I want them to redirect to
http://somename/webname/default.asp.
Update:
I have been checking like this in global.asa.
Application("txtPathInfo") = Request.ServerVariables("PATH_INFO")
if (Application("txtPathInfo") <> "/webname/default.asp") then
Response.Redirect("/webname/default.asp")
end if
But the problem is, first time it is working fine,redirecting to desired page. Next attempt it allows, may be the global.asa is not called while trying to access in same session. Please anyone provide some feasible solution on this. Thanks :)
One quick way is to put this code in a default.asp page in each possible folder.
<%
Response.Redirect "http://somername/default.asp"
%>
If there are too many folders or some of those folders don't physically exist you'll need to use a url rewrite rule or code within a custom 404 error page.
For rewrite rules this will depend on which version of IIS you are running. If IIS6 then I'd recommend IIRF but if you're running IIS7 or IIS8 then use the built in url rewrite module (installed via Web Platform Installer).

301 redirect from classic ASP with parameter to ASP.net page on Volusion

I need to redirect 1000's of URL's of the following format:
http://egauges.com/vdo_mult3.asp?Type=Ammeter&Series=Vision&Units=E
to a new Volusion (unfortunately) ASP.net site with the format
egauges.com/Ammeters-s/22044.htm
Which is actually here for now (http://gnqvn.mzqlg.servertrust.com/Ammeters-s/22044.htm)
The old site will go away once this is working, so redirects must be done on the new site.
Volusion has a 301 redirect "tool", but unfortunately it can't handle anything after the ? in the original URL. Volusion kicked it up the chain in their tech support, but says there isn't a way to do it. I'm sure some sort of script, either server or client side, or maybe even something simpler would work, but despite searching high and low, I can't figure it out.
Thanks!
Dave
Do the redirect directly in the asp site.
Change vdo_mult3.asp so that it redirects anyone who accesses it by using Response.Redirect as follows:
Response.Redirect("http://egauges.com/Ammeters-s/22044.htm")
You can also check the parameters passed to and change the redirect passed on those parameters.

Change the broswer's address name

how can I change the broswer's address name?? For example I have this: www.example.es/Pages/site.aspx and I want this: www.example.es/site
How can I do that?? Ty.
you can use the 404 error challenge and Server.transfer() to do URL rewriting using classic asp
Things you need
How to create a custom 404 page
Regular expression pattern to recreate actual file path or a predefined list
eg:-www.example.com/pg1/ ---> /pages/pg1.asp
Simple server.transfer() to handle valid / invalid server requests.
<%
IF Request.ServerVariables("SCRIPT_NAME") = "pg1" THEN
Server.transfer("/pages/pg1.asp")
ELSE
Response.write("404 - Page not found");
END IF
%>
that's all you are doing basic level URL rewriting using classic asp.
Your question asks about .aspx (asp.net) pages, but your question is tagged asp-classic... you will get better responses to future questions by using the correct tag.
In this case: as long as you can install a module on your server, and you're server can process ASP.Net's web.config files, you can use the IIS URL Rewrite module that Graham mentioned in the comments. I've got an old ASP-Classic site that uses the module just fine.
If you can install an extension, you could also use Ionics Isapi Rewrite Filter. Some hosts have this installed already.
All things being equal, if you have the ability to run your choice, I'd go with the IIS URL Rewrite Module as I've generally seen better performance from it. But that may just be me.
If you do not have that kind of access to the server, and there's not something already installd, you may have to go with the 404 mapping Jeevaka Nuwan Fernando mentions.
There are some other options, but they depend on if you are using ASP.Net or ASP-Classic.

Customize the request to get data from another URL resources

The situation is as follows: a CMS system (close source) doesn't use friendly URLs in the manner that we want. It add sub-maps and a static .aspx file and we don't that. Example: the CMS recognizes this: /public/submap/bla/page.aspx?id=CONTACT (page 'contact' in this example). But we want friendly URsL for this page like this: /contact.
My goal: before the CMS engine renders the page, that an incoming request (/contact) will change to the CMS recognized URL (/public/submap/bla/page.aspx?id=CONTACT) but the browser doesn't see this.
I've tried this on some pages with HTTPModule (interface IHttpModule, event BeginRequest) but the only possible way is to redirect 300 to the browser (it will recevied '/contact' and do a redirect to /public/.../page.aspx?id=CONTACT which the browser address toolbar shows).
It there a manner to 'fake' the CMS engine that will recognized it's own URL but between browser and ASP.NET an another URL?
Environment: IIS6 (Windows 2003) and .NET Framework 3.5/4.0.
Server.tranfer is the solution.

Creating SEO friendly urls in Classic ASP

I have to make all links SEO friendly on our website.
I have the following url: http://newark.storeboard.com/board.asp?RegionID=353&ClassAdCatID=740&IsEvent=1&IsCoupon=0&IsBlog=0
I need it be: http://neward.storeboard.com/classifieds/events/ConcertsLiveMusic
I have no way of accessing the IIS so this has to be done thru code. Any ideas about how to achieve this would be greatly appreciated.
Many Thanks,
Paul
The standard way of solving this as far as I know is to use a rewrite engine in IIS (such as ISAPI_rewite or IIS7 url rewrite module)
However, you don't have access to IIS you say... That makes it tricky. Two thoughts come to mind:
1) Could you create a dynamic (asp) 404 page that then looks at the request header and does a transfer according to the page requested?
2) Or, and this is rather lame, could you create a static folder structure that goes some way to looking like that url structure?
If you upgrade to IIS7 and use ASP.Net then you can control the URL rewrite module from your code.
I've done something similar to Matts suggestion 1 in the past and it can work. The important thing is you make the 404 page directly feed the true page content and not do a redirect. Otherwise your defeating the point of SEF URLs for SEO gain.
From the few references I still have to the code. asp has a Server.Transfer() function but you may have issues that you can't pass query string parameters. I think I ended up streaming the real page through the 404 page using the MSXMLServerXMLHTTP object and Response.BinaryWrite().

Resources