Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm doing something similar at the moment, migrating a huge static html store to on run on django (it's painful and bloody).</p> <p>Our solution isn't anything particularly elegant. During migration of each page, we are noting the old url, then the new url, and add them to a redirect database. Once we've migrated all of our content to the new backend and url structure, we're running a script that will identify all links in the document with these xpath selectors:</p> <pre><code> //a/@href //img/@src </code></pre> <p>Next we pull up the redirects from our redirect table and replace the links with the regexes below.</p> <pre><code>#escape special characters to avoid problems with the regex link = link.replace('#', r'\#') link = link.replace('.', r'\.') link = link.replace('/', r'\/') link = link.replace(':', r'\:') #compile a regex, using the source link, and replace all existing links repl_regex = r'href\s{0,}\=[\s\"\']{0,}(%s)[\s\"\']{0,}'%link markup = re.sub(repl_regex, 'href="%s"'%dst_url, markup) #repeat for images repl_regex = r'src\s{0,}\=[\s\"\']{0,}(%s)[\s\"\']{0,}'%link markup = re.sub(repl_regex, 'src="%s"'%dst_url, markup) #Let me know if you have any questions, the above is written in python #and it sounds like you're using php and a .net language. </code></pre> <p>Now while this method is probably more work than you'd like, and will require a little more upfront preparation, it has two advantages:</p> <p>1) By comparing every link in a document to a redirect table, you will be able to more easily identify missing pages / missing redirects</p> <p>2) SEO. Instead of making the googlebot recrawl your entire site, simply provide 301 redirects against your redirect table</p> <p>Let me know if you have any questions.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload