IIS Search Engine Optimization and Canonical Url with Dynamic Image - iis

I get the following error below for my dynamic image generator. It can have any kind of width or height but SEO is complaining about it because it needs a canonical URL. How can I do this with a dynamic image that isnt a page?
The page with URL "http://localhost/assets/images/99?w=125" can also be accessed by using URL "http://localhost/assets/images/99?w=100".
Search engines identify unique pages by using URLs. When a single page can be accessed by using any one of multiple URLs, a search engine assumes that there are multiple unique pages. Use a single URL to reference a page to prevent dilution of page relevance. You can prevent dilution by following a standard URL format.

The canonical URL can be specified in a HTTP header, too. See RFC 6596, section 4:
or alternatively, in the HTTP header field as specified in Section 5 of [RFC5988]:
Link: <http://www.example.com/page.php?item=purse>; rel="canonical"

Related

Remove question mark from URL query

Is there any way I can remove the question mark from URL using Mod_Rewrite like this?:
domain.com/controller-name?parameter/parameter/parameter
to change question mark after controller-name to slash
domain.com/controller-name/parameter/parameter/parameter
I want to add this to htaccess in PrestaShop, where I send query like this: parameter/parameter/parameter to controller.
Normal Presta URL is domain.com/index.php?controller=controller-name and I set on SEO settings friendly URL to this controller to rewrite to only controller-name so SEO friendly URL is domain.com/controller-name .
To send some parameters to this controller I can use URL like this: domain.com/controller-name?(here parameters)
In my controller I grab parameters after question mark ? and show content according to this parameters. The parameters are separated by a slash. So I want to get rid of question mark and replace it by slash to get: domain.com/controller-name/(here parameters) with parameters I want to look like this domain.com/controller-name/parameter/parameter/
When I use URL domain.com/controller-name/parameter/parameter/ shows error 404 and Presta don't see that I want content from controller-name.
I think it is achievable by mod_rewrite rule in .htaccess, but I don't know how to write rule according to this problem.
OR maybe there is a way to add something to controller or SEO configuration in Presta to work with / instead ? in query... that would be great solution...
You can use the history.pushState and history.popState to change the URL in the browser which won't cause a page reload. But the problem is that old browsers don't support this.
Alternatively, you can set the window.location.hash property to a value that contains whatever state information you need, then either use the window.onhashchange event, or for older browsers that don't support onhashchange (IE < 8, Firefox < 3.6), periodically check to see if the hash has changed (using setInterval for example) and update the page. You will also need to check the hash value on page load to set up the initial content.
If you're using jQuery there's a hashchange plugin that will use whichever method the browser supports. I'm sure there are plugins for other libraries as well.
One thing to be careful of is colliding with ids on the page, because the browser will scroll to any element with a matching id.

RewriteRule - redirect multi variable URL to multi variable URL

Our old website has a search URL structure like this:
example.com/Country/United States/Region/California/Area/Southern California/City/San Diego/Suburb/South Park/Type/House/Bedrooms/4/Bathrooms/3/
This is currently rewritten to point to the physical page:
/search/index.aspx
The parameters in the URL can be mixed up in different orders, and the URL can include one or more parameters.
We want to 301 redirect these old URLs to a new structure that is ordered in a logical way and more concise:
example.com/united-states/california/southern-california/san-diego/south-park/?type=house&bedrooms=4&bathrooms=3
example.com/united-states/california/?type=house&bedrooms=4&bathrooms=3
Is there a way with URL rewriting to interrogate the old URL, work out what parameters are existing and then write out the new URL structure?
Even if we can limit it to just the Country, Region, Area, City and Suburb, that may be good enough to at least return some results even if it's not perfect.
Also, spaces should be turned into hyphens and all text made lowercase.
I already have the RewriteRule to turn the new URL structure into a URL to point to a physical page. It's just transforming the old URL in to the new URL I need help with. I've googled endlessly and it's just beyond me!
Can anyone help? Thanks.
Since you already have the old search page with rewriting rules set up for it and which is capable of parsing all parameters you need, the easiest and most appropriate solution I see here is to issue a redirect you require from this old search page's code. Just put the code that composes new URL with all parameters needed and redirects from this page - this should be a lot easier than trying to parse all these parameters in .htaccess and combine them into the new format.

SharePoint 2013 crawl external website with querystring parameter

I need to index my company's employee manual, which is hosted on an external website. This page requires login, and supports auto-login through a query string parameter.
Like this: http://manual.externalprovider.com?token=xxxxxxxxx
When entering this URL in my content source I get no result and the following warning:
Item not crawled due to one of the following reasons: Preventive crawl
rule; Specified content source hops/depth exceeded; URL has query
string parameter; Required protocol handler not found; Preventive
robots directive. ( This item was deleted because it was excluded by a
crawl rule. )
Is it impossible to crawl content that has a query string parameter in the start addresss? Any other suggestions on how to solve this?
I think it is possible, but you need to create new crawl rule.
Go to Search Service Application -> Crawl Rules -> New crawl rule.
Then paste your starting url: http://manual.externalprovider.com/* and please check "Include all items in this path" and then "Crawl complex URLs (URLs that contain a question mark (?))".

Sharethis different results for domain with and without www

I put sharethis on my site, and if I go to the site andrewwelch.info without the www, then the shares are different from if I go to www.andrewwelch.info. How can I make sure that this doesn't happen?
ShareThis is rendered inside an IFRAME, and will use the parent frame's URL to determine the page someone is sharing.
You can add span tags with a st_url attribute to specify a canonical URL to use for a given page. An example is:
<span class="st_sharethis" st_url="http://sharethis.com" st_title="Sharing is great!"></span>
See here for more details.
As a side note: To improve your search engine rankings you should ensure your site doesn't present two different versions of each page. Search engines may reduce the relevancy of your site in results if this is the case. For example, the content of the following pages (and every other page on your site) are the same:
http://andrewwelch.info/
http://www.andrewwelch.info/
You need to fix this by choosing whether you want the "www" or not, then using one of the following methods:
Use a "canonical" meta tag to tell search engines which page is the one you want indexed.
Respond to requests for the "www" or "non-www" hostname with a 301 redirect to the other.

SEO - Will this url rewriting index particular image?

Example, if I have URL to particular image like (which doesn't exist on server):
domain.com/news/12/imgname.jpg
and i need to generate it on the fly and display it to the end user, i'll use some htaccess to rewrite previous url to:
domain.com/image.php?img=12/imgname
My question is: Will image imgname.jpg be indexed by the search engines (image.php in this case will return always the same image generated on the fly)?

Resources