.htaccess not being read


I have pretty much the same prob being described this SO thread

following response found there, copied this line of code

#LoadModule rewrite_module modules/mod_rewrite.so

into httpd.conf, then re-strated Apache 2, but it didn’t work at all, got an error, like when server is not turned on… (other sites, which don’t use .htaccess and normally work fine, also wouldn’t load…)

(but there’a another line similar to this one already in httpd.conf:

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

so not sure what to do…

now I have been running little sites on my php env locally, w/o .htaccess, everything works fine… (php env is Apache 2 & PHP 5.3.26, which all came with my mac…) but now am having probs w/this one b/c of the .htaccess file…

now for this particular site (also duplicated what’s up on server, to run locally, just like it’s described in SO thread above…) the .htaccess is used for navigation, the home page loads fine, but when click on any item in nav menu get a 404… content of .htaccess:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

thank you…

The line

#LoadModule rewrite_module modules/mod_rewrite.so

won’t do anything as it’s commented out. The # is for commenting out a command.

oh brother… :grin:

I know… I did take out the “#”… (remember I mentioned the server wouldn’t work after I included this line in httpd.conf…)

thank you…

now I included

LoadModule rewrite_module modules/mod_rewrite.so

after this line

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

and it didn’t make any difference… server still works, but my site with the .htaccess file won’t work (again: index.php loads, but when try to navigate to other pages I get 404’s…)

thank you…

Which of those two directories is mod_rewrite.so actually in?

oh brother… I don’t know… just searched for “mod_rewrite” in my mac HD… can’t find…


thank you for your response…

PS: but I think it must be libexec… because I found a lot of lines containing this dir… for example…

LoadModule dir_module libexec/apache2/mod_dir.so
LoadModule imagemap_module libexec/apache2/mod_imagemap.so
LoadModule actions_module libexec/apache2/mod_actions.so
LoadModule speling_module libexec/apache2/mod_speling.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule alias_module libexec/apache2/mod_alias.so

(but can’t find a file called mod_rewrite.so… oh brother… :anguished: )

thank you…

and I can’t find any dir called “apache2” – only “apache”… go figure…

so does all this work, then???

and all the dirs “apache” are related to Tomcat & Ant, i.e., they’re for J2EE environment…

there are no “apache2” dirs…


Are you sure you understand how RewriteBase worls?

Try commenting out that line.

Just a shot in the dark here, but make sure AllowOverride None is changed to AllowOverride All in the server’s config file.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.