使用Apache本地主机服务器上的.htaccess文件 [英] Use .htaccess file on an apache localhost server
问题描述
好吧,我得到了一个Apache本地主机服务器和PHP与MySQL的运行。现在,我希望能够用的.htaccess
文件,并使用重写规则
,但我在一个损失在哪里把它。
Alright, I got an Apache localhost server up and running with PHP and MySql. Now I want to be able to use a .htaccess
file as well to use RewriteRule
, But I'm at a loss where to put it.
我有以下目录:
C:\ dev的\ progs的
其中阿帕奇PHP和MySQL的存储方式,各自在自己的子目录,即。 C:\ dev的\ progs的\ Apache的
等等...
C:\dev\progs
where Apache PHP and MySQL are stored, each in their own sub-directories, ie. C:\dev\progs\Apache
and so on...
C:\ dev的\ WWW
,所有的网站文件存储
C:\dev\www
where all the site files are stored.
我需要知道在哪里放置的.htaccess
的文件,我需要什么样的配置做了,如果我是我的希望和梦想都是为了什么。
I need to know where to put the .htaccess
file, what configuration I need to do, and if what I'm my hopes and dreams are all for nothing.
感谢
推荐答案
的.htaccess是一个应该被存储在您的网页是一个配置文件。总之,它应该在 C:\ dev的\ WWW
在你的情况,但你应该阅读的this 的了。顺便说一句,不要忘记打开了mod_rewrite通过从它所在
.htaccess is a configuration file that should be stored where your page is. In short, it should be in c:\dev\www
in Your case, but You should read this too. BTW don't forget to turn on mod_rewrite by deleting a hash from the line where it resides
LoadModule rewrite_module modules/mod_rewrite.so
和启用了.htaccess通过更改
and enable .htaccess by changing
AllowOverride None
到
AllowOverride All
这篇关于使用Apache本地主机服务器上的.htaccess文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!