Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Server Details:

FreeBSD PHP Version 4.3.11 Apache

Appache Modules:

mod_throttle, mod_php4, mod_speedycgi, mod_ssl, mod_setenvif, mod_so, mod_unique_id, mod_headers, mod_expires, mod_auth_db, mod_auth_anon, mod_auth, mod_access, mod_rewrite, mod_alias, mod_actions, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation, mod_mime, mod_mime_magic, mod_log_config, mod_define, mod_env, mod_vhost_alias, mod_mmap_static, http_core

The issue I am having is when ever I write any kind of code in the .htaccess file, it throws a 500 Internal error

I am simply trying to rewrite url's and am using the exact code that wordpress creates for me and even tried custom code used before on previous servers and it still does not work.

WordPress created code:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /lobster-tail-blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /lobster-tail-blog/index.php [L]
</IfModule>

# END WordPress

And even a simple thing like this throws the error:

<IfModule mod_rewrite.c>
    RewriteEngine On
</IfModule>

Anyone know of any fixes or why this is causing this error? I have the mod_rewrite module loaded

share|improve this question
    
Look in your httpd.conf, it should have an entry telling you where to find your errorlog file. It will tell you what's apache is unhappy about. Post the error you get when you add your rewrite code. –  David Jul 30 '09 at 0:53
add comment

4 Answers 4

Off the top of my head, .htaccess doesn't need the bits. Your .htaccess should be OK with just

RewriteEngine On
RewriteBase /lobster-tail-blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /lobster-tail-blog/index.php [L]

In it. Failing that, what gets written to your httpd-error.log?

share|improve this answer
    
According to apache docs, <IfModule is acceptable at all contexts . –  Kristaps Jul 29 '09 at 19:25
1  
My bad, ignore that then Would still like to see httpd-error.log though –  Ben Quick Jul 29 '09 at 19:35
add comment

Check AllowOverride directive, it can be configured per directory context, like AllowOverride All It should be set to AllowOverride FileInfo to allow mod_rewrite (reference: http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride)

share|improve this answer
    
When using AllowOverride it still gives me this error. Anything I write in this file gives me an error. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. –  Will Ayers Jul 30 '09 at 21:42
    
I would second the idea of looking for the AllowOverride setting for the directory that contains the .htaccess file... I would also check the servers error log for any clue as to why it's giving the 500 error as it should state something to narrow your search down. –  Jeremy Bouse Aug 12 '09 at 22:51
add comment

Try specifying:

<IfModule mod_rewrite>
    # your settings
</IfModule>

Thus without the .c bit

share|improve this answer
add comment

Hmmm... Are you certain it's a 500 and not a 403? if the perms are wrong on the .htaccess file, Apache will reject all requests with a 403.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.