I am trying to setup a local environment on my Windows 10 machine (to knock out some overtime) but keep running into a problem. Let me start with my environment workflow on Mac OSX... I have developed many sites locally over the years using MAMP Pro, allowing me to have a host for each project. However, at home I have just recently switched to the Windows environment. I downloaded MAMP Pro for Windows (which is identical at least in UI) and setup everything. I worked for a bit just fine, but didn't notice until now, that if you try to go to any other page but the home page, I get a 403 Forbidden Error. I can even kick start this error by saving permalinks (renders the entire host/site as a 403, nothing works.)
The only way I can get the site to appear again is to remove everything from the .htaccess
file. Then I have the homepage again (admin works fine) but thats it. When I save permalinks this is what it produces in the .htaccess
file:
# 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
I feel like my question might be kind of broad, but what could the issue be here? Is it permissions? I feel pretty well versed in in servers/unix/permissions but throwing Windows into the picture gets me hung up. I'm also using Cmder for a command line tool.
I am trying to setup a local environment on my Windows 10 machine (to knock out some overtime) but keep running into a problem. Let me start with my environment workflow on Mac OSX... I have developed many sites locally over the years using MAMP Pro, allowing me to have a host for each project. However, at home I have just recently switched to the Windows environment. I downloaded MAMP Pro for Windows (which is identical at least in UI) and setup everything. I worked for a bit just fine, but didn't notice until now, that if you try to go to any other page but the home page, I get a 403 Forbidden Error. I can even kick start this error by saving permalinks (renders the entire host/site as a 403, nothing works.)
The only way I can get the site to appear again is to remove everything from the .htaccess
file. Then I have the homepage again (admin works fine) but thats it. When I save permalinks this is what it produces in the .htaccess
file:
# 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
I feel like my question might be kind of broad, but what could the issue be here? Is it permissions? I feel pretty well versed in in servers/unix/permissions but throwing Windows into the picture gets me hung up. I'm also using Cmder for a command line tool.
Share Improve this question asked Feb 14, 2017 at 5:30 erwstouterwstout 3022 silver badges9 bronze badges 1- this sounds like mod_rewrite is not enabled, although not sure why would you get a 403 in that case but maybe it is a mamp thing – Mark Kaplun Commented Feb 14, 2017 at 13:17
2 Answers
Reset to default 0While not really a an answer when it comes to MAMP's problem on Windows. Installing WAMP and running WordPress there instead fixed this issue.
You have to add your project directory name into RewriteBase and RewriteRule.
For Example:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745226891a4617502.html
评论列表(0条)