http://www.webmasterworld.com Welcome to WebmasterWorld Guest from 38.103.63.18
register, login, search, glossary, subscribe, help, library, PubCon, announcements , recent posts, unanswered posts
PubCon Conference Partner
Home / Forums Index / The Webmaster World / Apache Web Server
Forum Library : Charter : Moderators: jdMorgan

Apache Web Server

  
Activate mod rewrite on apache (windows)
cattox


#:3646755
 4:16 pm on May 10, 2008 (utc 0)

Hi,

I'm trying to activate mod rewrite on apache 2.2 running on windows xp as a windows service.

I uncommented the "LoadModule rewrite_module modules/mod_rewrite.so" line on the configuration file. I can't find the "AddModule mod_rewrite.c" and if I add it to the file, the server fails to start.
I tryed to override the accessfile name to remove the dot from the name (.htaccess -> htaccess) thrue "AccessFileName htaccess".
I configured the Directory options with:


<Directory />
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

even with qualified path just to be shure:


<Directory "C:/Programas/Apache Software Foundation/Apache2.2/htdocs">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

My test is simple, but it just won't work. Yhis is my
.htaccess:


rewriteEngine on
rewriteRule ^/test\.html$ /works.html

I have the works.html on the root folder. When I hit the test.html on the browser I get the error:

[Sat May 10 16:01:28 2008] [error] [client 127.0.0.1] File does not exist: C:/Programas/Apache Software Foundation/Apache2.2/htdocs/test.html

Does anyone have a hint for me? I'm running out of options..

thanks in advance

jdMorgan


#:3646850
 6:15 pm on May 10, 2008 (utc 0)

Are you actually using MultiViews (content-negotiation)?

If not, don't enable it, as it can interfere with mod_rewrite.

Two errors:

1) In order to use mod_rewrite, you must enable the FollowSymLinks or SymLinksIfOwnerMatch option, as specified in the mod_rewrite documentation. I'd suggest changing your Options directive to:

Options Indexes FollowSymLinks

2) In a per-directory (.htaccess) context, the path to the current directory is stripped from the URL-path "seen" by RewriteRule; In other words, the RewriteRule URL-path is "localized" to that particular .htaccess file's directory. In this case, it means that the leading slash will not be present on the URL-path, so the pattern in your rule will never match. Try:

RewriteRule ^test\.html$ /works.html [L]

Jim

cattox


#:3650144
 8:58 pm on May 14, 2008 (utc 0)

It works! You're the man.

Thanks :)

 

Home / Forums Index / The Webmaster World / Apache Web Server
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of WebmasterWorld Inc.
© WebmasterWorld Inc. / SearchEngineWorld 1996-2008 all rights reserved