How to redirect old url to new url using htaccess, php and meta


 


 
If you move your site without loosing your search engine ranking and incoming links then following script will be helping you

Your OLD URL is : http://www.hariomrubber.com/request-a-quote.html
and you want to redirect it on new url like
New Rewrite URL: http://www.hariomrubber.com/contact-us.html

then you have to use below script in your .htaccess file
Below script is a rewrite URL htaccess

RewriteCond %{REQUEST_URI} ^/request-a-quote.html$
RewriteRule .* /contact-us.html [L,R=301]

if you open old url then it will be redirect to new url.

Or, if you simply want to redirect all URLs from the old domain to a specific page on the new domain
then add this to the root .htaccess file on the old domain:

RedirectMatch 301 / http://www.hariomrubber.com/about-us.html

Redirect from one file type to another

If you want to change the extension of your web pages, Like .php to .html and file names remaining the same then add below script to your .htaccess:

RedirectMatch 301 /(.*)\.php http://hariomrubber.com/$1.html

Removing file extension via .htaccess

If you have the following URLs for your website:
http://www.hariomrubber.com/about-us.html

However, you would like to hide file extensions from the end users, and allow them to access to the files using the following URLs:
http://www.hariomrubber.com/about-us

then you have to use following in your .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
# Replace html with your file extension, eg: html, php, asp

Alternate redirect methods via meta tag

Redirect via tag in the document. below meta tag add after your head tag in your html

<head><meta http-equiv="refresh" content="3; url=http://hariomrubber.com/">

Alternate redirect methods via PHP

To redirect via PHP, add following code in your file:

     header ('HTTP/1.1 301 Moved Permanently');
     header( "http://hariomrubber.com/" );

Will be add more blog about htaccess file.

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

Advertisements

How to add “google-site-verification” code in your site


 


 
How to Verify Your Site with Google Webmaster Tools

To verify your site and get your meta tag content:

 =>  Go to the Google Webmaster Tools page: Webmaster Tools
 =>  To add a site, click on Add a site.
 =>  Enter the URL for your site.
 =>  Select the Alternate methods tab and then choose the Add meta tag method (first one in the list).
 =>  Copy the value that it gives you for the content parameter of the google-site-verification meta tag. Example: <meta name="google-site-verification" content="yuOLc7bLXFLCZTERTmcXnEPCe9f6pIE9kFYQNpH8gJI">
 =>  Copy the following verification code below and paste it into the Keywords area under the SEO tab.
	<meta name="google-site-verification" content="yuOLc7bLXFLCZTERTmcXnEPCe9f6pIE9kFYQNpH8gJI">
 =>  Open the Webmaster Tools home page again. Make sure that you don't have any requests to verify your site again. If you do, verify it again. 

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

Put meta tag on top of header section in typo3


 
In order to prevent quirks mode in IE9 I need to add this lines at the very top of every HTML page:

You can write the whole header by yourself, by adding disableAllHeaderCode = 1 to your typoscript or you can hack it by adding your meta tag directly to the head tag:

page.headTag = <head><meta http-equiv="X-UA-Compatible" content="IE=edge" />

Place this at your typoscript

meta.X-UA-Compatible = IE=edge,chrome=1

httpEquivalent: (Since TYPO3 4.7) If set to 1, the http-equiv attribute is used in the meta tag instead of the “name” attribute. Default: 0.

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

How to change doctype in TYPO3


 
How to add doctype in TYPO3

Sets the document type for the XHTML version of the generated page.

If config.doctype is set to a string then config.xhtmlDoctype must be set to one of these keywords:

xhtml_trans for XHTML 1.0 Transitional doctype.

xhtml_frames for XHTML 1.0 Frameset doctype.

xhtml_strict for XHTML 1.0 Strict doctype.

xhtml_basic for XHTML basic doctype.

xhtml_11 for XHTML 1.1 doctype.

xhtml_2 for XHTML 2 doctype.

This is an example to use MathML 2.0 in an XHTML 1.1 document:

config.doctype (
  <!DOCTYPE html
      PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
      "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
)
config.xhtmlDoctype = xhtml_11

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

How to add meta tag in typo3


 
For display meta tag in typo3 you have to follow below step.

It is just easy to set meta tag in your project..

For that you just have to add below typoscript in you setup.

You can add your meta data in your page property ( In Metadata Tab). That meta data will display in your meta tag.

page.meta {  
  description.field = description
  description.ifEmpty = Description of your project
  keywords.field = keywords
  keywords.ifEmpty =  Keyword of your project
  abstract.field = abstract
  abstract.ifEmpty = abstract of your project
} 

If description is empty then you need to display other field like title of subtitle then you can set below typoscript

  description.field=description
  description.ifEmpty{
    field= title // subtitle
    required = 1
  }

You can do same with keyword and abstract as well.

If you have any query then feel free to contact me at Jainish Senjaliya