Allow for the possibility of a part of the URL being removed

Consider what happens when a user removes part of your URL Some users might navigate your site in odd ways, and you should anticipate this. For example, instead of using the breadcrumb links on the page, a user might drop of a part of the URL in the hopes
of finding more general content.

He or she might be visiting http://
http://www.brandonsbaseballcards.com/news/2016/upcoming-baseballcard-shows.htm,

but then enter http://www.brandonsbaseballcards.com/news/2016/ into the browser’s address bar, believing that this will show all news from 2016. Is your site prepared to show content in this situation or will it give the user a 404 (“page not found” error)? What about moving up a directory level to http://www.brandonsbaseballcards.com/news/?

A site map (lower-case) is a simple page on your site that displays the structure of your website, and usually consists of a hierarchical listing of the pages on your site.

Visitors may visit this page if they are having problems fiding pages on your site.

While search engines will also visit this page, getting good crawl coverage of the pages on your site, it’s mainly aimed at human visitors.

An XML Sitemap (upper-case) file, which you can submit through Google’s Webmaster Tools, makes it easier for Google to discover the pages on your site. Using a Sitemap fie is also one way (though not guaranteed) to tell Google which version of a URL you’d prefer as the canonical one (e.g. http://brandonsbaseballcards.com/ or http://www.brandonsbaseballcards.com/; more on what’s a preferred domain). Google helped create the open source Sitemap Generator Script to help you create a Sitemap file for your site. To learn more about Sitemaps, the Webmaster Help Center provides a useful guide to Sitemap fies

Capture

Make your site easier to navigate

Navigation is very important for search engines

The navigation of a website is important in helping visitors quickly fid the content they want. It can also help search engines understand what content the webmaster thinks is important.
Although Google’s search results are provided at a page level, Google also likes to have a sense of what role a page plays in the bigger picture of the site.

Plan out your navigation based on your homepage

All sites have a home or “root” page, which is usually the most frequented page on the site and the starting place of navigation for many visitors. Unless your site has only a handful of pages, you should think about how visitors will go from a general page (your root page) to a page containing more specific content. Do you have enough pages around a specific topic area that it would make sense to create a page describing these related pages (e.g. root page -> related topic listing -> specific topic)?

Capture
Site structure

Do you have hundreds of different products that need to be classified under multiple category and subcategory pages?

404 (“page not found” error)
An HTTP status code. It means that the server could not find the web
page requested by the browser.

Ensure more convenience for users by using ‘breadcrumb lists’

A breadcrumb is a row of internal links at the top or bottom of the page that allows visitors to quickly navigate back to a previous section or the root page (1). Many breadcrumbs have the most general page (usually the root page) as the fist, left-most link and list the more specific sections out to the right.

Capture
Breadcrumb links appearing on a deeper article page on your site

XML Sitemap
A list of the pages on a particular website. By creating and sending this list, you are
able to notify Google of all pages on a website, including any URLs that may have been
undetected by Google’s regular crawling process.

 

 

How to re-order rows in a table with incorrect ordering in SQL

Capture

Imagine you have this scenario – the order of a table which relies on its order has been muddled up by some bad code and you wish to sort it out with the least effort possible.

You can write a quick SQL script which will reset the order to the right set (seen on the right).

To find out what your order should be, include the ROW_NUMBER() command as below:

select *
,ROW_NUMBER() OVER(ORDER BY Orders ASC) AS Row
from DM_ReportColumns where [conditions]

Then you can run an update based on your primary keys (in this scenario, I have ReportID, Username and ColumnID as keys.

UPDATE DM_ReportColumns SET Orders = x.Row 
from (
select *
,ROW_NUMBER() OVER(ORDER BY Orders ASC) AS Row
 from DM_ReportColumns where ReportID  = 'A01' and Username = 'user1'
) as x
WHERE x.ReportID = DM_ReportColumns.ReportID 
AND x.Username = DM_ReportColumns.Username 
AND x.ColumnID = DM_ReportColumns.ColumnID

After

Capture2