4

I'm trying to set up a local WP environment on my machine. My .htaccess file (which is in the same folder as my index.php file) looks like this:

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

# END WordPress

My MAMP database should be set up correctly Every time I try to view the site in my browser, I get:

Not Found

The requested URL /wordpress was not found on this server.

My wp-config.php file looks like this:

define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'root');

/** MySQL hostname */
define('DB_HOST', 'localhost');

I haven't tried to move anything around, so I'm not trying to update permalinks. I've tried changing the ports on MAMP, trying various strings of URLs (including port number, trying to navigate to specific pages within the site, etc. I've tried everything suggested on The requested URL /about was not found on this server and WP's guidelines (though they seem to solve issues only after people have installed plugins — I'm just trying to set up the basic initial WP download).

Any suggestions? I'm at a total loss for what else to try. Any help is greatly appreciated — thank you!

Here's my folder structure (in my sites folder, which is where MAMP is directed): screenshot of folder structure

Community
  • 1
  • 1
Kate Miller
  • 190
  • 1
  • 1
  • 10
  • did you check if .htaccess is actually being honored? If `AllowOverrides` is off, htaccess files are simply ignored. quick/dirty test: stuff some random junk into the .htaccess to cause a syntax error and see if the server barfs with a 500. – Marc B Aug 22 '16 at 16:44
  • I think this is on the right track, so it seems like .htaccess is being ignored. Sorry to be clueless — where do I edit `AllowOverrides`? – Kate Miller Aug 22 '16 at 16:53
  • https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride – Marc B Aug 22 '16 at 16:55
  • @KateMiller What's your folder structure. Where is your wordpress actually placed and where is apache pointing to? – Aaron Aug 22 '16 at 17:18
  • @KateMiller Where's your wordpress directory located. You're getting the error message because apache can't find the /wordpress directory. – Aaron Aug 22 '16 at 17:50
  • @Aaron, I found the Apache files in the MAMP folder under Applications and it was set to the wrong path — I've fixed this, and it solved the problem. Thank you for your guidance!!! – Kate Miller Aug 22 '16 at 18:09
  • Do you ever find the solution to this post ? – code-8 Oct 29 '16 at 18:39

2 Answers2

5

a2enmod rewrite

service apache2 restart

Jay D
  • 3,263
  • 4
  • 32
  • 48
Yoweli Kachala
  • 423
  • 6
  • 13
0

I have the same problem, and the solution was to activate the rewrite_module on the apache.

Brane
  • 3,257
  • 2
  • 42
  • 53