Subscribe
Tutorial search

PHP Redirection Tutorials


We hope that you will enjoy our PHP Redirection tutorials. Feel free to contact us if you would like to be a tutorial hero and contribute your own PHP Redirection tutorial to our site. Thank you !

Sort by:
URL Rewrite for more than 9 variable using PHP by make configuration in .htaccess file
URL Rewrite for more than 9 variable using PHP by make configuration in .htaccess file
Rewrite URL for more than 9 variable in .htaccess file One of the more powerful tricks of the .htaccess is the ability to rewrite URLs. This enables us to do some mighty manipulations on our links; useful stuff like transforming very long URL's into short, cute URLs, transforming dynamic ?generated=page&URL's into /friendly/flat/links, redirect missing pages, preventing hot-linking, performing automatic language translation, and much, much more. For example we have link like this : www.domain.com?read_blog.php?id=2 with article title "htaccess trick for friendly URLs" The above url form are difficult to read by google, let's try this url www.domain.com/read_blog/2/htaccess_trick_for_friendly_urls/ It is more beauty, and from url we know the article title. Google like this url. To create the .htaccess we use this form. RewriteEngine on RewriteRule ^read_blog/([0-9]+)/([0-9a-zA-Z_]+)/?$ read_blog.php?id=$1 [L,QSA] for more variable we can make it like this RewriteEngine on RewriteRule ^read_blog/([0-9]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)?(/data/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+))?$ read_blog.php?id=$1&title=$2&pagetitle=$3&keyword=$4&description=$5&author=$6&about=$7&link=$8&colour=$9&country=$10&city=$11&state=$12 [L,QSA] for this case we might have faced error where .htaccess wont recognize the backtrack variable after $9 such that if you specify $10? then it will return you to $0? as value to that key in URL param. The mod_rewrite module is confused which varible to return $1 or $0. Back-references are identifiers of the form $N (N=0..9), which will be replaced by the contents of the Nth group of the matched Pattern. In the above RewriteRule, the variables $10 and $11 will return 0 and 1 as values respectively. Now let us look at the workaround to this problem. RewriteCond %{REQUEST_URI} /(data/([A-Za-z0-9_]+)/(.+)/(.+))?(/.+)$ RewriteRule ^read_blog/([0-9]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)?(/data/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+))?$ read_blog.php?id=$1&title=$2&pagetitle=$3&keyword=$4&description=$5&author=$6&about=$7&link=$8&colour=$9&country=%2&city=%3&state=%4 [L,QSA] Using the above RewriteCond and RewriteRule we can grab the values of the group after 9.
Difficulty:
Redirection after some time delay in php
Redirection after some time delay in php
In this programming tutorial we will learn how to perform redirection after some time delay in php. It is quite easy in php. I will demonstrate this with two methods.
Difficulty:
Create a Link Shortener Tool
Create a Link Shortener Tool
In this tutorial, you will lean how to create a link (URL) shortening system, similar to Bit.Ly.
Difficulty:
Creating a short url service like bit.ly with php and mysql
Creating a short url service like bit.ly with php and mysql
Learn how to create a short url service just like tinyurl.com with php, mysql and mod_rewrite in less than an hour!
Difficulty:
Macronimous - The need for PHP code refactoring
Macronimous - The need for PHP code refactoring
Refactoring is changing of complex and complicated programming codes into simple and confusion-less ones, thereby restructuring the complete set of codes into easily readable formats, without any change in the output or functionality.Refactoring does not include fixing of glitches or including of new functionalities or practices to the existing set of codes.
Difficulty:
 Disappearance www in the site url
Disappearance www in the site url
the solution to the www disappearance in your site url
Difficulty:
PHP Redirect Tutorial
PHP Redirect Tutorial
Tutorial demonstrating how to use PHP to perform a redirect. Discusses temporary redirect, permanent redirects, and conditional redirects.
Difficulty:
Page Redirection Using a URL Variable - Like anonym.to
Page Redirection Using a URL Variable - Like anonym.to
This tutorial will show you how to make a redirection script using a URL variable. Similar to that on http://anonym.to/
Difficulty:
Redirecting the Web Browser with PHP
Redirecting the Web Browser with PHP
Learn how to use HEADER functions to redirect the users web browser transparently using PHP.
Difficulty:
Time Based Pages
Time Based Pages
Redirect the user to a different page depending on what time of the day it is.
Difficulty:
How To Redirect or Cloak Affiliate Links
How To Redirect or Cloak Affiliate Links
This tutorial will show you how to redirect your affiliate links using a PHP script and a simple edit to your .htaccess file. For some reason users seem to trust links more if the reside on your own server. Using a "link cloaking" technique is an easy way to increase revenue from affiliate offers.
Difficulty:
Redirect a User Based on His Geographic Location
Redirect a User Based on His Geographic Location
This code uses a web service to determine each user's location and allows you to redirect the user or dynamically create a page based on that information.
Difficulty:
simple redirection
simple redirection
For designer who use many html files for his/her site to specific browser, this is just a sample you can customise by yourself.
Difficulty:
PHP Auto Redirection
PHP Auto Redirection
Learn how to make auto redirection with PHP. There is nothing much to learn, just a little code.
Difficulty:
PHP Redirect
PHP Redirect
Learn how to perform a redirect in PHP. A PHP Redirect automatically transfers a web user from one URL to another. For example, typing foo.com in the browser automatically transfers the user to another URL bar.com.
Difficulty:
Total Tutorials in Category: 22