虚拟主机或.htaccess中的重定向301对php文件不起作用。
我的环境: apache 2.4 php-fpm 7.0
我的vhost配置:
<VirtualHost *:80>
ServerAdmin xxx@example.com
DocumentRoot /pathto/www/
DirectoryIndex index.htm index.php index.html
ServerName www.example.com
<Directory "/pathto/www/">
RewriteEngine on
Redirect 301 /myfile.php "http://www.example.com/page"
Redirect 301 /contact "http://www.example.com/contacts.htm"
Include /pathto/www/.htaccess
</Directory>
ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/run/php/php7.0-fpm.sock|fcgi://localhost/pathto/www/
</VirtualHost>
重定向301 /file.php也在.htaccess中,但没有人在工作。所有其他基于uri或别名的重定向规则都可以正常工作!?
帮助欣赏。
https://stackoverflow.com/questions/50656629
复制相似问题