Jump to content

newbie mod_rewrite confusion


newborn

Recommended Posts

Hello.

Sure would appreciate some help with this voodoo.

I am a total beginner with mod_rewrite.

At this point I am just trying to understand whether there is something up with my syntax or something with the hosting.

 

I have this very simple file to test if mod_rewrite is even working:

 

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteRule hello\.html hello2.html
</IfModule>

 

Navigating to http://xxx.xx.xxx.xx/hello.html, the server returns this error:

The requested URL /usr/home/cen887/www/htdocs/hello2.html was not found on this server.

 

I can navigate directly to http://xxx.xx.xxx.xx/hello2.html no problem.

 

The hosting company used this to prove that mod_rewrite was active, and it does work:

 

RewriteEngine on
RewriteRule ^(.*) http://www.google.com [L]

 

I guess I am totally perplexed with the above error, since I know that file exists, what would keep the browser from simply navigating to that file using the htaccess file?

 

Thank you very much for any advice!

Link to comment
https://forums.phpfreaks.com/topic/135604-newbie-mod_rewrite-confusion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.