
10-12-2008, 09:50 AM
|
|
|
The htacess code i'm using is
Quote:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]
|
Take note my file isn't at the root directory. It is at /ilix.in
Rewrite.php
Quote:
<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><< <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>
|
|

10-12-2008, 06:22 PM
|
|
View Beta Profile
Community Liaison
|
|
Join Date: Feb 2005
Location: Australia
Posts: 3,420
|
|
Do you have anything else in your .htaccess apart from those lines? Looking at the source of the blank page it's not entirely blank - have you been trying to set up a custom 404 error document?
This would be a simpler way to test whether mod_rewrite is enabled (if it is, every request for your site will be redirected to a Google search):
Code:
RewriteEngine On
RewriteRule (.*) http://www.google.com/search?q=$1 [L]
__________________
Chris < ClonePanel>
"Not everything that can be counted counts, and not everything that counts can be counted" - Albert Einstein
|

10-12-2008, 09:34 PM
|
|
|
Quote:
Originally Posted by foobic
Do you have anything else in your .htaccess apart from those lines? Looking at the source of the blank page it's not entirely blank - have you been trying to set up a custom 404 error document?
This would be a simpler way to test whether mod_rewrite is enabled (if it is, every request for your site will be redirected to a Google search):
Code:
RewriteEngine On
RewriteRule (.*) http://www.google.com/search?q=$1 [L]
|
If the mod_rewrite works, it should show something that you should see in this host:
Misc. Host that has no problem with Mod_rewrite
http://www.webune.com/tutorials/mod_rewrite/rewrite.php
And regarding the google link, what url should i use to test if it works?
|

10-12-2008, 10:09 PM
|
|
View Beta Profile
Community Liaison
|
|
Join Date: Feb 2005
Location: Australia
Posts: 3,420
|
|
Obviously that example is not working for you. The question is whether it's because mod_rewrite is not enabled or because of something wrong in your implementation of it (or perhaps something else in your account). Hence the simple alternative test.
Quote:
Originally Posted by kohkindachi
And regarding the google link, what url should i use to test if it works?
|
It doesn't matter - with that in your .htaccess
Quote:
Originally Posted by foobic
every request for your site will be redirected to a Google search
|
__________________
Chris < ClonePanel>
"Not everything that can be counted counts, and not everything that counts can be counted" - Albert Einstein
|

10-12-2008, 10:14 PM
|
|
|
Try using this php code to test:
PHP Code:
<?php if (in_array("mod_rewrite", apache_get_modules())) { echo "mod_rewrite loaded"; } else { echo "mod_rewrite not loaded"; } ?>
__________________
Managed Multi-domain Shared, Reseller, VPS, Dedicated, Shoutcast Hosting
FFMPEG, PHP5, cPanel/WHM, Fantastico, Site Migration, Wordpress, Magento Ready!
Mxhub.com - Since 2001 - USA - UK - Canada - Europe - Singapore
|

10-12-2008, 10:44 PM
|
|
|
Ignore the above post. That doesn't work.
Try test using a 301 redirect:
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.yahoo.com/$1 [R=301,L]
If mod_rewrite is install, your site get redirect to yahoo.com
--
joseph
__________________
Managed Multi-domain Shared, Reseller, VPS, Dedicated, Shoutcast Hosting
FFMPEG, PHP5, cPanel/WHM, Fantastico, Site Migration, Wordpress, Magento Ready!
Mxhub.com - Since 2001 - USA - UK - Canada - Europe - Singapore
|

10-12-2008, 11:21 PM
|
|
|
Quote:
Originally Posted by Mxhub
Ignore the above post. That doesn't work.
Try test using a 301 redirect:
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.yahoo.com/$1 [R=301,L]
If mod_rewrite is install, your site get redirect to yahoo.com
--
joseph
|
Thx...Since my root leads to my main domain http://www.zwlimitx.com. I've added the above code to .htaccess to my root, but...i dun see any redirection :/
|

10-12-2008, 11:23 PM
|
|
|
Quote:
Originally Posted by foobic
Obviously that example is not working for you. The question is whether it's because mod_rewrite is not enabled or because of something wrong in your implementation of it (or perhaps something else in your account). Hence the simple alternative test.
|
The question is not really whether mod_rewrite is enable or not. If it dun work(from the test)... i'm asking for advice 
|

10-12-2008, 11:28 PM
|
|
|
Quote:
Originally Posted by kohkindachi
Thx...Since my root leads to my main domain http://www.zwlimitx.com. I've added the above code to .htaccess to my root, but...i dun see any redirection :/
|
www.zwlimitx.com doesn't resolve to an ip..
I assume the .htaccess file just contain that redirect code ,right?
__________________
Managed Multi-domain Shared, Reseller, VPS, Dedicated, Shoutcast Hosting
FFMPEG, PHP5, cPanel/WHM, Fantastico, Site Migration, Wordpress, Magento Ready!
Mxhub.com - Since 2001 - USA - UK - Canada - Europe - Singapore
|

10-12-2008, 11:52 PM
|
|
|
Quote:
Originally Posted by Mxhub
www.zwlimitx.com doesn't resolve to an ip..
I assume the .htaccess file just contain that redirect code ,right?
|
The redirection works now thx  But i've no idea why the test I posted earlier dun work :/
|

10-13-2008, 12:28 AM
|
|
|
Quote:
Originally Posted by kohkindachi
The redirection works now thx  But i've no idea why the test I posted earlier dun work :/
|
Great!
--
joseph
__________________
Managed Multi-domain Shared, Reseller, VPS, Dedicated, Shoutcast Hosting
FFMPEG, PHP5, cPanel/WHM, Fantastico, Site Migration, Wordpress, Magento Ready!
Mxhub.com - Since 2001 - USA - UK - Canada - Europe - Singapore
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|