User Tools

Site Tools


help:web_pages

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
help:web_pages [2016/10/13 22:51] – created peterhelp:web_pages [2020/04/15 11:59] (current) – removed peter
Line 1: Line 1:
-====== Web Pages ====== 
  
-Having a unique URL ("canonicalization") for each webpage is important in improving your "Pagerank" Canonicalization is accomplished by redirecting non-standard webpages to a preferred ("standard") webpage.  There are a number of ways to redirect a webpage, but 301 (HTTP/1.1 Status Code, "Moved Permanently") redirect is the search engine friendly method which passes the pagerank and search engine ranking status from old to a new page.  Here is an examples of how 301 redirect can be implemented on LAMP (Linux/Apache/Mysql/PHP) environment. 
- 
-===== PHP Redirect ===== 
- 
-<code php> 
-<?php 
-Header( "HTTP/1.1 301 Moved Permanently" ); 
-Header( "Location: http://www.new-url.com" ); 
-?>  
-</code> 
- 
- 
-===== Apache .htaccess: non-www to www subdomain redirect ===== 
- 
-1. Make sure your httpd.conf file has the "Directory" directive with the "AllowOverride All" setting. 
- 
-<code apache> 
-<Directory /path/to/your/domain/document/root> 
-  AllowOverride All 
-</directory>  
-</code> 
- 
- 
-2. Enable Mod-Rewrite Module 
- 
-Your apache configuration should have the mod-rewrite module enabled, which is the default. You can verify this by perusing httpd.conf file for the following line: 
- 
-<code apache> 
-LoadModule rewrite_module modules/mod_rewrite.so 
-</code> 
- 
- 
-3. Create a .htaccess file in the document root directory of your website with the following content. 
- 
-<code apache> 
-RewriteEngine On 
-RewriteCond %{http_host} ^example.com [nc] 
-RewriteRule ^(.*)$ http://www.example.com/$1 [r=301,nc]  
-</code> 
- 
-Just replace the "example.com" with the domain name you're trying to redirect. 
help/web_pages.1476399077.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki