.htaccess在Apache EC2 Linux服务器中不工作

.htaccess在Apache EC2 Linux服务器中不工作,.htaccess,amazon-ec2,httpd.conf,.htaccess,Amazon Ec2,Httpd.conf,模式重写已启用(通过info.php测试进行检查 在etc/httpd/conf/httpd.conf文件中AllowVeride 在/var/www/html中插入.htaccess RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteR

模式重写已启用(通过info.php测试进行检查 在etc/httpd/conf/httpd.conf文件中AllowVeride

在/var/www/html中插入.htaccess

RewriteEngine On
 RewriteBase /wordpress/
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /wordpress/index.php [L]
(要从主页重定向到wordpress子目录…)

重新启动Apache

service httpd restart
但Apache主页显示在…上

请求被删除时wordpress主页

我错过了什么吗?(EC2/httpd上的假人)谢谢,错了。htaccess! 应该是(在/var/www/html目录中)


#启用“重写”。
重新启动发动机
#不适用于指向现有文件或文件夹的URL。
重写cond%{REQUEST_FILENAME}!-f
重写cond%{REQUEST_FILENAME}!-d
#仅适用于尚未在/wp下的URL。
重写条件%{REQUEST_URI}!^/wordpress/
#重写所有这些以插入/wordpress
重写规则^(.*)$/wordpress/$1
#重定向根文件夹。
重写cond%{HTTP_HOST}^(www.)?yodojodo.net$
重写规则^(/)?$wordpress/[L]
wordpress目录的根站点..我重新测试了一个modified.htaccess(见我的答案),它可以工作。。。
<IfModule mod_rewrite.c>

# Turn on rewrites.
 RewriteEngine on

# Don't apply to URLs that go to existing files or folders.
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d

# Only apply to URLs that aren't already under /wp.
 RewriteCond %{REQUEST_URI} !^/wordpress/

# Rewrite all those to insert /wordpress
 RewriteRule ^(.*)$ /wordpress/$1

# Redirect the root folder.
 RewriteCond %{HTTP_HOST} ^(www.)?yodojodo.net$
 RewriteRule ^(/)?$ wordpress/ [L]
 </IfModule>