Thursday, 5 March 2015

How to create Dynamic XML Sitemap online?

How to create Dynamic XML Sitemap online?

Question: What is XML Sitemap?
An XML sitemap is a document that helps Google, Bing, Yahoo and other search engines for better understanding your website while crawling it. It have all website URLs with updating details of URL.


Queston: Why do you need a Sitemap?
For each website who need traffic from the Search Engines (Google, Yahoo, MSN etc), have to add the XML sitemap in your website.


Question: Sitemap need for New Website only?
No, XML Sitemap should be for New as well as Old website (Need for both type website).


Question: What are Main elements of XML Sitemap?
Element Required? Description
loc Yes Provides the full URL of the page or sitemap, including the protocol (e.g. http, https) and a trailing slash, if required by the site's hosting server. This value must be shorter than 2,048 characters.
lastmod No The date that the file was last modified, in ISO 8601 format. This can display the full date and time or, if desired, may simply be the date in the format YYYY-MM-DD.
changefreq No How frequently the page may change:
  • always
  • hourly
  • daily
  • weekly
  • monthly
  • yearly
  • never
priority No The priority of that URL relative to other URLs on the site. This allows webmasters to suggest to crawlers which pages are considered more important.



 Question: What is Format of XML SiteMap?





<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xsi:schemalocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <url> <loc>http://example.com/</loc> <lastmod>2006-11-18</lastmod> <changefreq>daily</changefreq> <priority>0.8</priority> </url> </urlset>

Question: What should name of XML Sitemap?
sitemap.xml


Question: Where should I placed the sitemap.xml?
It must be on root folder. So that crawler can easily access it.
For Example.
http://www.web-technology-experts-notes.in/sitemap.xml


Question: From where I can generate sitemap?
http://www.xml-sitemaps.com/


Wednesday, 4 March 2015

How to redirect https to http in htaccess

Today, htaccess play very important role for SEO, It is used for redirection, rewriting and apache config variable etc.
How to edit your htacess file.
Open your .htaccess file which is mostly in root folder OR in public/public_html folder.
Use following code as per your requirement.(Please have backup your .htaccess file before editing).


https://example.com to http://example.com redirect
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


https://example.com to http://www.example.com redirect
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


http://example.com to https://example.com redirect
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]


http://example.com to https://www.example.com redirect
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]