The local wordpress website home page runs well but mod_rewrite
does not work. So, the home page works, but as soon as I click any link I get Not Found
.
Log output for this error:
[error] [client 127.0.0.1] File does not exist: /Applications/MAMP/htdocs/myweb/my-web-page-that-has-to-work, referer: http://myweb.dev/
As per my understanding, the error would mean that it looks for that specific page instead of using mod_rewrite
in order tot get the page from database.
httpd.conf
relevant content:
# Virtual hosts, uncommented include
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
...
# AllowOverride All is here
<Directory "/Applications/MAMP/htdocs">
Options All
AllowOverride All
Order allow,deny
Allow from all
XSendFilePath "/Applications/MAMP/htdocs"
</Directory>
httpd-vhosts.conf
relevant content:
<VirtualHost *:80>
DocumentRoot /Applications/MAMP/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Applications/MAMP/htdocs/myweb"
ServerName myweb.dev
ServerAlias www.myweb.dev
ErrorLog "/private/var/log/apache2/myweb-error_log"
CustomLog "/private/var/log/apache2/myweb-access_log" common
</VirtualHost>
Any clue on how to get it to work?
First make sure Apache loads the module. See: How to enable mod_rewrite for Apache 2.2
Then add this to an .htaccess file inside your folder
or just add it to your httpd-vhosts.conf like this. CORRECTED:
Now add your rewrite rules for WP and see if it works.
You may check if Apache is loading the module with a PHP script inside your folder. Try this and proceed from there.