Apache 如果放入子目录,则htaccess不工作
Apache不会在我的别名目录中加载我的.htaccess文件 如果我将.htaccess文件放在根文件夹(D:/Development)和项目文件夹(D:/Development/code/project)中Apache 如果放入子目录,则htaccess不工作,apache,.htaccess,Apache,.htaccess,Apache不会在我的别名目录中加载我的.htaccess文件 如果我将.htaccess文件放在根文件夹(D:/Development)和项目文件夹(D:/Development/code/project)中 http://localhost/filename.html 将我重定向到stackoverflow http://localhost/project/filename.html 返回找不到404 我在Windows7 64位上运行xampp 为什么我不能在我的子目录中使用.htacce
http://localhost/filename.html
将我重定向到stackoverflow
http://localhost/project/filename.html
返回找不到404
我在Windows7 64位上运行xampp
为什么我不能在我的子目录中使用.htaccess
httpd.conf:
<Directory />
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Deny from all
</Directory>
<Directory "D:/Development">
Options +Indexes +FollowSymLinks +Includes +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
因为您只对文件/filename.html进行了重定向
将代码的第一行替换为
redirect 301 filename.html http://stackoverflow.com
index.php
文件是在文档根目录中还是在project
目录中?index.php在我的project目录中。但问题是,my.htaccess没有加载到my/project目录中
redirect 301 /filename.html http://stackoverflow.com
AddDefaultCharset utf-8
RewriteEngine ON
RewriteRule ^(stylesheet|images|favicon) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /index.php [NC,L]
redirect 301 filename.html http://stackoverflow.com