Question on mod_rewrite on JWS 3.0

Latest response

I am trying to use mod_rewrite to redirect a url such as https://example.com to https://example.com/someContext

I have configured the following virutalhost:

DocumentRoot /opt/redhat/jws-3.0/httpd/www/example.com
ServerName example.com

RewriteEngine On
Rewrite ^(.*) someExample/$1 [L,R,PT]

Once I start up the httpd server, I see the following error in the log:

AH00526: Syntax error on line 11 of /opt/redhat/jws-3.0/httpd/conf.d/ssl_example.conf:
Invalid command 'Rewrite', perhaps misspelled or defined by a module not included in the server configuration

Do I need to enable mod_rewrite?

Thanks!

Responses

I'ved tried enabling it with "LoadModule rewrite_module /opt/redhat/jws-3.0/httpd/modules/mod_rewrite.so" in httpd.conf with no success.

Please disregard. I found that i was using the incorrect directive - Rewrite instead of RewriteRule.

Thanks for letting us know.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.