problem with .htaccess in vhosts

Problems with the Windows version of XAMPP, questions, comments, and anything related.

problem with .htaccess in vhosts

Postby cookxyz » 19. March 2007 20:44

I am using xampp for my development environment. For each site that I work on I create a vhost on my local machine for dev and testing. All this works fine, until I tried to move the location of my vhosts (to another hard-drive). Apache seems to ignore the .htaccess files for the sites in the new location.

My working vhosts are located at:
C:\Program Files\xampp\htdocs\vhosts\siteName

My new vhosts are located at:
H:/workspace/siteName/www/app/webroot

So I created my directives normally like this:
Code: Select all
<VirtualHost *:80>
   ServerName siteName
   DocumentRoot "H:\workspace\siteName\www\app\webroot"
</VirtualHost>

So that site works, but the .htaccess file is ignored.


So I changed the httpd.conf to reflect the new structure:
Code: Select all
<Directory "H:/workspace">
  Options Indexes FollowSymLinks Includes ExecCGI
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>

And still it did not work, so I tried this:
Code: Select all
<VirtualHost *:80>
   <Directory "H:/workspace/siteName/www/app/webroot">
          Options Indexes FollowSymLinks Includes ExecCGI
          AllowOverride All
          Order allow,deny
      Allow from all
   </Directory>
   ServerName siteName
   DocumentRoot "H:\workspace\siteName\www\app\webroot"
</VirtualHost>

and I tried this:
Code: Select all
<Directory />
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

and I tried this:
Code: Select all
<Directory "h:/">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

And all to no avail. My hair is gone, my forehead is bloody, and still won't work. Anyone have any ideas????

Thank you,
cook
cookxyz
 
Posts: 3
Joined: 19. March 2007 20:28

followup

Postby cookxyz » 19. March 2007 20:59

Just in case you want to know what is in the .htaccess file:
Code: Select all
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>

This rewrite is used by cakePHP to direct all traffic through index.php.
I know there is nothing wrong with this, cause it works fine elsewhere.

Also, can anyone tell me if it possible to create log entries from the .htaccess file? If so I could try debugging things...
cookxyz
 
Posts: 3
Joined: 19. March 2007 20:28

Postby Wiedmann » 19. March 2007 21:05

And still it did not work, so I tried this:
[code]

That's the correct way. But this is only a part of your vhost config?

BTW: Allways use forwardslashs.

Apache seems to ignore the .htaccess files

Really? Make an error in this ".htaccess" and see what happens.

BTW:
"error.log"?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

solved

Postby cookxyz » 19. March 2007 22:20

Confused and stupid!

So I checked the error log as you suggested. didnt find anything. Then I changed the htaccess file from :

Code: Select all
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>


to
Code: Select all
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]



Then I got some useful info from the error log:
.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration.



So, as I said, "Confused and stupid!". I'm stupid because mod_rewrite was not enabled.
#LoadModule rewrite_module modules/mod_rewrite.so

But I'm confused, because this worked previously, and I did not disable mod_rewrite!

Anyway it's all better now. Thank you.
cookxyz
 
Posts: 3
Joined: 19. March 2007 20:28


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 59 guests