You are here:Home»KB»Web Server»htaccess»Is mod_rewrite installed on your server
Friday, 26 February 2010 21:22

Is mod_rewrite installed on your server

Written by

Use this code to test if  mod_rewrite installed on your server

  1. Create a rewrite.php file
  2. Paste this code into it
    <h2>How To Test mod_rewrite in Apache Linux Server by <a href="http://www.webune.com">Webune</a></h2>    
    <p><a href="/rewrite.php?link=1">LINK1</a> = rewrite.php?link=1</p>
    <p><a href="/link2.html">LINK2</a> = link2.html</p>
    <p>How this works: both links are for this same page, except they both are different. link one is without the mod_rewrite and link2 is using mod_rewrite. Link1 show the php file, with with mod_rewrite we are mascarading the php file into a html file. you can use whatever type of extension you want, you can change it to .htm or .shtml etc... all you have to do is to make sure you also chang it in the .htaccess file</p>
    <p><a href="http://www.webune.com/forums/viewtopic-p-43.html">Go back to webune forums.</a></p>
  3. Create a .htaccess file with the following code
    RewriteEngine On
    RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]
  4. Upload both files to your www root
  5. Execute rewrite.php

Links

Read 1099 times Last modified on Saturday, 09 December 2017 15:38