homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

mod_rewrite question from a beginner

 4:07 pm on Dec 6, 2002 (gmt 0)

Hi people,

I am trying to learn the basics on the mod_rewrite function, and already have read many things so far. The only problem is, I cannot seem to get things working. I will explain my situation, and paste the error logs.

My current setup is Apache 1.3.22 running on Windows 2000.
The path of the htdocs-path is the following:
c:/program files/apache group/apache/htdocs

The rewrite logfile is located at c:/rewrite/rewrite.log

I have 2 files in a directory called test:

c:/program files/apache group/apache/htdocs/test

one of them is day.html, the other one is night.html

In this directory, I also have a .htaccess file, with the following content:

rewriteBase /test/
rewriterule ^day.html night.html

But this gives me the following error message: - - [06/Dec/2002:17:07:47 +0100] [www.testing.nl/sid#7859b0][rid#86a408/initial] (2) init rewrite engine with requested uri /test/day.html - - [06/Dec/2002:17:07:47 +0100] [www.testing.nl/sid#7859b0][rid#86a408/initial] (1) pass through /test/day.html

And simply shows day.html in my browser...

How do I make night.html appear eventhough I entered day.html in the browser window?



 4:11 pm on Dec 6, 2002 (gmt 0)


I have had a bit of help on this one lately

Do you have the Rewrite engine on?


rewriterule ^day\.html$ /night.html

So when you look for day you get night but the URLsays day.

I think that is it. Read the post above for some good help off Jim.



 4:15 pm on Dec 6, 2002 (gmt 0)

Well, I think rewriteEngine must be on, otherwise it wouldn't produce a logfile would it?

I have changed my .htaccess file into:

rewriteBase /test/
rewriteRule ^day\.html$ /night.html

Like you told me, but it keeps displaying day.html, and keeps displaying the same loginfo...


 4:52 pm on Dec 6, 2002 (gmt 0)


Welcome to WebmasterWorld [webmasterworld.com]!

You might want to try these two variants - post your relevant log and error file results if neither works:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /test
RewriteRule ^day\.html /night.html [L]

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^day\.html /night.html [L]



 5:07 pm on Dec 6, 2002 (gmt 0)

Seems to work now, thanx!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved