Mod rewrite PHP to HTML htaccess
|
|
Software -
Scripting
|
|
Written by DanielRo
|
In this tutorial you are going to learn how you can rewrite all your PHP pages to HTML using a simple .htaccess rule for better search engine indexing. This is a basic page.php to page.html htaccess script.
In this tutorial we are providing a script that can only work if you are hosted on a Linux server. If you are not hosted on Linux then you should checkout the popular Bluehost.com hosting
they have been providing hosting solutions to thousands of business and personal web sites since 1996.
There is a myth saying that search engines will better index your site if your pages are displayed like static HTML.
Personally I don't believe it actually makes a difference for search engines if your pages are either PHP or HTML but in the long run it can increase your sites security.
The language your site is coded in is irrelevant and also a security vulnerability, if people know what language your site is coded in, they'll more easily be able to exploit any code vulnerabilities.
Say for example you have a website and a menu witch is dynamically built using PHP, you could only use it on PHP pages.
Example:
You have menu.php and all the pages of your site: index.php, services.php, portofolio.php, contact.php
Using the following script you will be able to access the contents of all your pages using a HTML extension.
The .htaccess file starts here
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.html$ $1.php [L]
One would also have to change all the links trough out the website from the PHP extension to HTML.
Your visitors can now access the contents of services.php using services.html
Using this htaccess basic PHP to HTML rewrite rule you can present PHP files as HTML.
- Install Photoshop on Ubuntu Linux
Believe it or not Photoshop CS2 is now fully supported on Ubuntu Linux using Wine. For a long period of time I was eager in switching to Ubuntu but the incompatibility of my most used Windows based applications always made me switch back to Linux. No more Windows based Photoshop skills, now you can powerup Photoshop on Ubuntu.
- How to 301 Redirect Non-WWW to WWW URLs
One of the first things you should consider when starting any SEO work on a website is deciding if you are going to use the www.example.com or example.com base URL.
Many search engines consider those two URLs different, other sites that link to yours could also use different versions of your URL and that mix can really hurt on the long run.
- Google AdSense with Allowed Sites
Every AdSense Publisher had nightmares when hearing of all the horror stories where people get banned from AdSense because someone else used their AdSense code on malicious sites, breaking the Google AdSense TOS.
This all ended when Google decided to listen to the community and build the Allowed Sites feature.
- Adding a bump to a photo in Photoshop
In this Photoshop tutorial you are going to learn how to add a bump to a photo increasing its artistic effect and making it more realistic.
- HOW TO: Disable the SEND ERROR REPORT
In this short tutorial you are going to learn how to disable the annoying Windows XP feature that prompts you with a "Send error report" window whenever a program crashes.
Subscribe now via RSS feed and get all the new tutorials
|
|
Last Updated ( Saturday, 09 February 2008 )
|