LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Strange htaccess problem (it ignored!) (https://www.linuxquestions.org/questions/linux-software-2/strange-htaccess-problem-it-ignored-296098/)

belorion 02-28-2005 10:37 PM

Strange htaccess problem (it ignored!)
 
I have 2 vhosts on my Apache 2.0.51 (On RH Fedora 2) server.

I'm trying to get mod_rewrites to work in my second host. I have an .htaccess file in my public/ directory. Here is the relevant portion of my httpd.conf:

<VirtualHost *:80>
ServerName www.example.com
DocumentRoot /var/www/applications/myapp/public/

<Directory "/var/www/applciations/myapp/public/">
AllowOverride All
</Directory>
</VirtualHost>

So, I can browse to this site just fine. But it behaves as if the .htaccess file is *completely* ignored. All of my rules in .htaccess are just never used.

If I paste in the content of my .htaccess file and put them within the virtualhost directive above, everything works fine. But if i take it out and rely on the .htaccess file... it just doesn't work. The .htaccess file is completely ignored.

Any idea why this is and how I can fix it?

david_ross 03-01-2005 01:59 PM

Does it work if you specify it in the Directory directive?

Did you build apache with rewrite support?

Perhaps you could post a copy of your .htaccess file.

belorion 03-01-2005 02:32 PM

Thank you for the reply. I've got the problem fixed -- though I don't know how.

Basically, I said to myself "well, rewriting isn't happening using AllowOverride All for /var/www/applications/myapp/public, what if I set AllowOverride All for / ?" I know that that would turn on Overrides for *everything*, but I wanted to see if it would work.

It did.

So then I did it for /var/. That worked. Then /var/www/, etc. By the time I got back up to /var/www/applications/myapp/public, it was still working.

I know my spelling for the path was correct. I compared the two ... they were identicle. I have no idea why it started working when I did that, but it did.


All times are GMT -5. The time now is 07:49 AM.