-
All replies
-
Helpful answers
-
Jun 24, 2016 5:17 PM in response to bb03by cdhw,I rather doubt that you do need to modify mod_rewrite itself, but it's here:
/usr/libexec/apache2/mod_rewrite.so
I think it is more likely that you want to mess with
/etc/apache2/httpd.conf
or the appropriate .htaccess file.
C.
-
Jun 27, 2016 4:23 AM in response to bb03by John Lockwood,While a normal Mac uses /etc/apache2//httpd.conf a Mac which has Apple's Server.app installed uses /Library/Server/Web/Config/apache2/httpd_server_app.conf instead.
Furthermore as far as I can tell the mod_rewrite is loaded as standard. In my conf file the following line is listed.
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
If it was not being loaded there would be a # at the beginning of the line.
To use this module you either have to create a .htaccess file in the root folder of your website and enable the use of a .htaccess file in the settings for that website, or you need to use the option in Server.app to configure redirect rules for your site or a final option but less common would be to hand edit the .conf file for your website and in that add the relevant commands to do redirections.
You should not normally try and modify or replace Apple's own provided programs which in this case includes mod_rewrite. I did have an instance where I myself needed to use a different version of mod_xsendfile to the version Apple provide. In that case it was because the version Apple provided did not support a specific command the XSendFilePath command. The better way to resolve this was not to try modifying or directly replacing Apple's version but instead to change the line in the httpd_server_app.conf file to tell it to load my own copy from a different location. This way if/when Apple install a newer version of their own file it does not overwrite your own version.