URL Rewriting Sometimes you may be seen the URL doesn’t have the extensions like .php, .html, .asp or anything else. Because they are aware of SEO and the security .Before going to the URL rewrite we see the small introduction of SEO. What is SEO? 1. SEO stands for Search Engine Optimization. 2. If you don’t know about SEO what do you first do? 3. Go for the Google or other search engines then type SEO and press enter. It provides the millions and millions of WebPages 4. But you read only the first few pages or first page alone. 5. So the website owners work hard to publish their pages in the first few pages. 6. What are the advantages for them? 7. They got advertising through the page rank. So they earn the lot. 8. For this purpose we go for the url rewriting. URL rewriting in PHP For this you need to run in the linux server. Step 1:Create the file using notepad or wordpad with extension “.htaccess”.It must be accurate. Step 2:save in the root directory. Step 3:create the PHP file <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Trial Test This I am going to test Then Watch
The URL Then Create the .htaccess file Options +FollowSymlinks RewriteEngine On # Prevent Directory Listing Options -Indexes RewriteRule ^([a-z0-9A-Z]+)/?$ index.php?a=$1 [QSA]
How it runs? • RewriteRule - Tells Apache that this like refers to a single RewriteRule. • RewriteEngine On- # Turn on the rewriting engine • # - Command Line • Options +FollowSymlinks – It is an optional Don’t forget to put $_GET on the PHP file.If you don’t put it it wont be run. Please try it and leave comments… For more information visit http://india-vinoth.blogspot.com