.htaccess not working on VirtualHost

Since I installed the wildcard VirtualHost my htaccess files no longer work

http-vhosts.conf

NameVirtualHost *

<VirtualHost *:80>
    ServerName default.dev
    VirtualDocumentRoot /Users/[UserName]/Sites/%-2
    <Directory /Users/[UserName]/Sites/%-2>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

      

.htaccess (WordPress default)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

      

I can access as http://wordpress.dev

well as the backend, but not the type page http://wordpress.dev/page

(throws a 404 error).
I can set the default persistent structure, but I would like to have "good urls"

I am on a local development environment on Mac OS X 10.10 with Apache 2.4

0


source to share


1 answer


Change the definition VirtualHost

to:

<VirtualHost *:80>
    ServerName default.dev
    VirtualDocumentRoot /Users/[UserName]/Sites/%-2
    <Directory /Users/[UserName]/Sites>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

      



ie, the root of the directory definition for Sites, not a virtual directory.

+1


source







All Articles