How to move pages and rename them without breaking incoming links from external sites that still use poorly formed URLs

Update

enter image description here

Here is the situation:

I am working on a site with no physical structure. Nothing was planned or controlled, and there were about 4 consecutive webmasters.

Here is an example of a particularly ugly directory

  • \new\new\pasite-new.asp

most pages are stored in a folder with the same name as the file for maximum redundancy.

  • \New\10cap\pasite-10cap.asp
  • \QL\Address\PAsite-Address.asp

each of these [page directories]? (I don’t know what else to call them) has an include folder, the include folder contains the same *.inc files in each case, it is simply copied about 162 times for each page directory. The include folder has been duplicated, so that <!--#include file="urlstring"--> will work correctly due to a lack of understanding of relative paths, and #inclue virtual directive or using server.execute()

Here is an image if I had no explanation.

directory structure


Here are some of my limitations:

  • The site is written in ASP classic
  • Server is Windows Server 2003 R2 SP2, IIS 6 (according to my resource)
  • I do not have access to the IIS server
  • I will need to go through the process to add any modules or functions to iis

What changes can I make to allow me to move pages and rename them without breaking incoming links from external sites that still use poorly formed URLs?

To clarify my question.

How to move the 10cap.asp file from \new\10cap\ to a more suitable place, for example \ , and rename the file to something like saveourhomescap.asp and do not break the incoming links and finally do not leave the fictitious 10cap.asp in the original location, redirecting to new page.

+4
source share
5 answers

You have many limitations and, especially, no access to the IIS server. The ISAPI module for rewriting URLs is not a parameter (IIS) here, and an equally custom 404 page where you could read the referent and forward with HTTP 301 will not work (IIS).

I would recommend you go through the process and let them install:

  • ISAPI URL Rewriter

or if this does not work (for any reason):

  • Let them point HTTP 404 of your website to user 404.asp , read the abstract and redirect using HTTP 301 (moved forever) to a new location.

If this is not an option for you, I can think of another possibility. I have not really tried this, so I'm not 100% sure if it will work, but theoretically it sounds good;)

You can make global.asa in global.asa in Session_OnStart or change the title of your response to HTTP 301. This will actually work only for new users, not for fixing real 404 errors. Sorry, for the pseudocode, but recently I had some something to do with classic ASP, and I think you get what I mean;)

 sub Session_OnStart ' here should be a Select Case switch or something like that Response.Redirect("newlocation.asp") ' or if that will work, this would be better (again with switch) Response.Status = "301 Moved Permanently" Response.AddHeader "Location", "http://company.com/newlocation.asp" end sub 

Hope this helps.

+1
source

Wow, there are a lot of limitations.

Can you customize the custom error page? If so, you can add code to the user error page, which redirects users to a new page. Therefore, perhaps you are creating a custom page 404, and on this page you take a string of a query string and based on this send the user to the correct "new" page. This will delete all old pages.

Here is a pretty good article on this method: rewrite URL for classic ASP

+2
source

I recommend using the Rewrite URL for this, see the following blog post about this, in particular "Reorganizing the Site":

http://blogs.msdn.com/b/carlosag/archive/2008/09/02/iis7urlrewriteseo.aspx

For more information on the Rewrite URL, see below: http://www.iis.net/download/URLRewrite

0
source

You can try ISAPIRewrite, as it is a classic ASP + IIS6 http://www.isapirewrite.com/

They have a lite version that is free, probably good enough for your use.

0
source

urlrewrite will only work if you can install the dll on the server

one of these articles will help

http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=qRR&q=url+rewrite+classic+asp&btnG=Search&aq=f&oq=&aqi=g-m1

basically, you should point 404 errors to the error page, which will analyze the incoming information about querystring / post and redirect the user to correct the location with the incoming parameters added.

variations of this theme will be found in google examples.

0
source

Source: https://habr.com/ru/post/1337829/


All Articles