How To Test Check If Mod_rewrite Is Enabled
how to test check if mod_rewrite is enabled
how, to, test, check, if, mod, rewrite, is, enabled
How To Test Check If Mod_rewrite Is Enabled
Post Description: how to test check if mod_rewrite is enabled
POST# 688
Posted On: Fri Feb 29, 2008 12:01 pm
webmaster
Topic: How To Test Check If Mod_rewrite Is Enabled
Webune customer benefit from apache's mod_rewrite. Every customer being hosted by our shared services has automatically mod_rewrite enabled. However, if you are still not sure whether you have this free service from Webune, you can confirm if its enable by following this simple guide. In this tutorial, you will be create two files, the first one called rewrite.php and the second one .htaccess - I will be using Windows XP notepad to create my files.

DEMO: You can test how it work in our server at the this link:

1. Create a php file called "rewrite.php" with your text editor (notepad)
2. Copy and paste the following code into rewrite.php
Code/Command:
<h2 align=center>
<?
// mod_rewrite Test Page
// Copyright 2006 Webune.com
if($_GET['link']==1){echo"You are not using mod_rewrite";}
elseif($_GET['link']==2){echo"Congratulations!! You are using Apache mod_rewrite";}
else{echo"Linux Apache mod_rewrte Test Tutorial";}
?>
</h2>

<hr>

<head>
<title>How To Test mod_rewrite in Apache Linux Server</title>
</head>

<body>
<p align="center">by <a href="http://www.webune.com">Webune</a></p>
<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>&lt;&lt; <a href="http://www.webune.com/forums/how-to-test-check-if-mod-rewrite-is-enabled-t40.html">Go back to webune forums.</a></p>
</body>
</html>


3. Save rewrite.php
4. Now create a file called .htaccess with your text editor like notepad
5. Copy and paster the following code into the .htaccess file:
Code/Command:
RewriteEngine On
RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]

6. Save as .htaccess (if you are using notepad as I am, make sure to put quotes in between. example: ".htaccess" otherwise, notepad will create a file called .htacces.txt and we don't need the .txt at the end only .htaccess)
7. Now upload these two file into a new directory in your site. for example: test
8. Pull the rewrite.php file with your browser to the location you just upoaded.
9. you should see two links, LINK1 and LINK2 Click on LINK1 and the same page will display.
10. Now click on LINK2 and the same page will display with the a mod_rewrite message. If it doesnt you either did something wrong. Check your steps. If you checked your steps, refresh your browser, and if refreshing doesnt work, then you dont have mod_rewrite enabled.

If you get a 500 Error, then you do not have mod_rewrite enabled in your server. Or if mod_rewrite is not working for you and you are a Webune customer, please contact our support team to assist you.

DEMO: Click on this link. We have provided uploaded the files in this tutorial to show you how mod_rewrite works.

Click here to See demo of mod rewrite file


Sun Mar 18, 2007 3:08 pm
1
lont
Reply #1570
this is a good and helpful to show or display how to check if server has mod_rewrite. thanks
Mon May 14, 2007 7:14 am
2
nioton
Reply #1571
sorry but this is not a useful code since you can not test it in a code and do some other action according to this ....
Sat Nov 10, 2007 11:36 am
3
Sean
Reply #1572
most excellent! thanks for this; i needed a quick "down and dirty" test and you provided it brilliantly. =o)

sean p. o. maccath-moran
emanaton
Tue Nov 13, 2007 12:34 pm
4
DR
Reply #1573
thanks very much - have been searching for something like this ..

not sure if everyone will get that:
8. pull the rewrite.php file with your browser to the location you just upoaded.
means - (put it in your browser's address bar )

thanks again

Tue Apr 01, 2008 10:45 am
5
kabaluddin
Reply #1793
hallo apa kabar
Tue Apr 01, 2008 12:02 pm
6
mod rewriter
Reply #1797
Picture 01--mod-rewrite.jpg
thanks it helps
Tue Apr 01, 2008 12:14 pm
7
linux apache user
Reply #1798
Picture 01--apache-logo.jpg
thanks for explaining this to me. i couldn't figure out why my Mod_Rewrite not working and with this i was able to learn how it works.

good job!!!!

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload
     
  1. How To Test Linux Apache Mod_rewrite Working
  2. What Is Mod_rewrite? Apache Module Mod_rewrite - URL Rewriting Engine
  3. Learn How To Use Apache Module Mod_rewrite Explained
  4. Enable Mod Rewrite - Howto Steps Guide Tutorial
  5. How To Test Check If Mod_rewrite Is Enabled
  6. Web Hosting With Apache Mod_rewrite Enabled
  7. How To Fix Mod_rewrite 500 Internal Server Error On .htaccess File Apache
  8. Apache Server Mod_rewrite Explain
  9. Web Hosting With Apache Mod Rewrite Enabled
  10. Learn-how-to-use-apache-module-mod-rewrite-explained-p350
  11. Testing If Mod_rewrite Is Working
  12. Mod Rewrite On Iplanet And Sun One Web Server
  13. How To Test Mod Rewrite In Apacher Server
  14. How To Check If .htaccess Is Working
  15. Mod_rewrite Apt-get
  16. Mod_rewrite Working
  17. Mod Rewrite Script