Web Hosting Talk


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Problem with Mod_rewrite @ Godaddy
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.

 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-12-2008, 09:16 AM
kohkindachi kohkindachi is offline
View Beta Profile
WHT Addict
 
Join Date: Apr 2006
Posts: 138
Problem with Mod_rewrite @ Godaddy

Guys click Link 1 and 2 to see the Mod_rewrite check.

Misc. Host that has no problem with Mod_rewrite
http://www.webune.com/tutorials/mod_rewrite/rewrite.php

My Godaddy site:
http://ilix.in/rewrite.php

Can anyone advice? Thx

Reply With Quote
Sponsored Links
  #2  
Old 10-12-2008, 09:50 AM
kohkindachi kohkindachi is offline
View Beta Profile
WHT Addict
 
Join Date: Apr 2006
Posts: 138
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>&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>

Reply With Quote
  #3  
Old 10-12-2008, 06:22 PM
foobic foobic is offline
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

Reply With Quote
Sponsored Links
  #4  
Old 10-12-2008, 09:34 PM
kohkindachi kohkindachi is offline
View Beta Profile
WHT Addict
 
Join Date: Apr 2006
Posts: 138
Quote:
Originally Posted by foobic View Post
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?

Reply With Quote
  #5  
Old 10-12-2008, 10:09 PM
foobic foobic is offline
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 View Post
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 View Post
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

Reply With Quote
  #6  
Old 10-12-2008, 10:14 PM
Mxhub Mxhub is offline
View Beta Profile
Web Hosting Master
 
Join Date: May 2001
Posts: 2,143
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



Reply With Quote
  #7  
Old 10-12-2008, 10:44 PM
Mxhub Mxhub is offline
View Beta Profile
Web Hosting Master
 
Join Date: May 2001
Posts: 2,143
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



Reply With Quote
  #8  
Old 10-12-2008, 11:21 PM
kohkindachi kohkindachi is offline
View Beta Profile
WHT Addict
 
Join Date: Apr 2006
Posts: 138
Quote:
Originally Posted by Mxhub View Post
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 :/

Reply With Quote
  #9  
Old 10-12-2008, 11:23 PM
kohkindachi kohkindachi is offline
View Beta Profile
WHT Addict
 
Join Date: Apr 2006
Posts: 138
Quote:
Originally Posted by foobic View Post
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

Reply With Quote
  #10  
Old 10-12-2008, 11:28 PM
Mxhub Mxhub is offline
View Beta Profile
Web Hosting Master
 
Join Date: May 2001
Posts: 2,143
Quote:
Originally Posted by kohkindachi View Post
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



Reply With Quote
  #11  
Old 10-12-2008, 11:52 PM
kohkindachi kohkindachi is offline
View Beta Profile
WHT Addict
 
Join Date: Apr 2006
Posts: 138
Quote:
Originally Posted by Mxhub View Post
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 :/

Reply With Quote
  #12  
Old 10-13-2008, 12:28 AM
Mxhub Mxhub is offline
View Beta Profile
Web Hosting Master
 
Join Date: May 2001
Posts: 2,143
Quote:
Originally Posted by kohkindachi View Post
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



Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement: