Re: Enabling mod_rewrite



On 2007-07-30 16:57, Barely Audible wrote:
Where (and probably how) do you enable the mod_rewrite module for a standard suselinux 10.2/apache installation?


This should be loaded from:
/etc/apache2/sysconfig.d/loadmodule.conf
LoadModule rewrite_module /usr/lib/apache2-prefork/mod_rewrite.so

But that may depend on your installed version, prefork or worker.

I don't use it myself, but have the apache2 documentation installed,
so whenever I will find out how it works, I go to mysite.mydomain/manual
and check it up.

Here is what it say about the module rewrite

For example, assume the following per-directory config file:

#
# /abc/def/.htaccess -- per-dir config file for directory /abc/def
# Remember: /abc/def is the physical path of /xyz, i.e., the server
# has a 'Alias /xyz /abc/def' directive e.g.
#

RewriteEngine On

# let the server know that we were reached via /xyz and not
# via the physical path prefix /abc/def
RewriteBase /xyz

# now the rewriting rules
RewriteRule ^oldstuff\.html$ newstuff.html


I can't give you everything, it was lot of information, pictures and stuff,
so install it yourself.

The example was for an .htaccess file, but it's clear the the module
must be activated by "RewriteEngine On" and you must set RewriteBase
if your path in the URL is not the same as the path on your machine.

/bb
.