如何让 htaccess 在 MAMP 上工作 [英] How to get htaccess to work on MAMP
问题描述
我正在尝试让 .htaccess
在 MAMP 中工作.
I am trying to get the .htaccess
working in MAMP.
.htaccess
的内容是一个简单的重定向行,但它不起作用.我试图操作 WordPress 页面的 URL,所以我在我的主题文件夹中添加了 .htaccess
文件,但它不起作用.
The content of the .htaccess
is a simple redirect line but it does not work. I am trying to manipulate URLs of a WordPress page, so I added the .htaccess
file in my theme folder, but it is not working.
我需要更改 MAMP 中的任何设置才能使 .htaccess
文件工作吗?
Is there any settings within MAMP i need to change to get the .htaccess
file to work?
推荐答案
转到 /Applications/MAMP/conf/apache
上的 httpd.conf
并查看 code>LoadModule rewrite_module modules/mod_rewrite.so
行未注释(开头没有 #)
Go to httpd.conf
on /Applications/MAMP/conf/apache
and see if the LoadModule rewrite_module modules/mod_rewrite.so
line is un-commented (without the # at the beginning)
并改变这些从...
<VirtualHost *:80>
ServerName ...
DocumentRoot /....
</VirtualHost>
为此:
<VirtualHost *:80>
ServerAdmin ...
ServerName ...
DocumentRoot ...
<Directory ...>
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory ...>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
这篇关于如何让 htaccess 在 MAMP 上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!