1

I'm working on a site which requires mod_rewrite rules in an .htaccess file.

But when uploading the file to this new OSX 10.6 Server install (with Apache 2.2.13) it just disappears. I'm pretty sure that this isn't just invisible files not being shown - I have these set to visible in my FTP app though I don't have shell access to verify they are there.

And phpinfo shows mod_rewrite as being enabled. Yet none of the rules are applied.

I am not the server admin but he says that any files beginning with a "." are not supported by any OSX servers. I'm pretty sure this isn't the case but wanted some clarification.

If this is actually possible and what advice might I give him for getting this to work?

3 Answers3

2

.htaccess files are disabled by default in OS X's Apache config. You can enable them with the Server Admin GUI by selecting the Web service in the sidebar -> Sites in the toolbar -> your virtual site under that -> Options tab under that, and enabling "Allow All Overrides". Or, equivalently, you can edit the site config file (under /etc/apache2/sites) and change the line that says AllowOverride None to AllowOverride All.

Gordon Davisson
  • 11,216
  • 4
  • 28
  • 33
1

Macs don't normally display files starting with a period - use TinkerTool to let you see them.

Chopper3
  • 101,299
  • 9
  • 108
  • 239
  • Yep I know they aren't usually displayed. Just wondering how this affects them as .htaccess files under Apache and whether it is indeed possible to use mod_rewrite rules on OSX at all. Surely it must be. –  Oct 18 '10 at 15:49
0

Hidden files are supported, they're treated as system files and hidden from the GUI view. Apache will still find the .htaccess file. However, it's possible apache isn't configured to use .htaccess files.

In general, .htaccess files use the same syntax as the main configuration files. What you can put in these files is determined by the AllowOverride directive. http://httpd.apache.org/docs/2.2/howto/htaccess.html

mazianni
  • 241
  • 1
  • 2