我在我的服务器上安装了nginx,FastCGI和PHP.WordPress 3.0经过一番怪物战斗后安装,但它的安装和运行良好.
但是,当我将固定链接设置更改为默认设置以外的任何设置时,我会在每个帖子,文章和页面上收到404错误.
我知道这与nginx不支持.htaccess和WordPress与页面被请求时的去向相混淆.
我在nginx conf文件甚至nginx兼容性插件中尝试了一些重写; 都没有奏效.通过一次重写,我设法停止了404错误,但是在我获得PHP确认页面之后,我没有找到WordPress的帖子.呸.
论坛上到处都是类似问题的人.有没有人有办法解决吗?
我有一个在Nginx上运行的Laravel站点,它很好.
它有一个普通的文件夹结构,如:
/app
/public
/vendor
...
Run Code Online (Sandbox Code Playgroud)
该/public文件夹是Laravel index.php所在的位置.
我已经安装了WordPress,/public/blog因为我希望我的博客可见mywebsite.org/blog.
如果我将定义的永久链接设置/blog/wp-admin/options-permalink.php设置为"默认"(这意味着帖子的URL看起来像/blog/?p=123),则博客目前正常工作. 如果我更改永久链接设置/blog/%postname%/,我无法查看帖子(我得到一个Laravel 404页面).
我绝对希望我的博客文章有SEO友好的URL(非常永久链接).
我目前的Nginx配置是:
server {
#This config is based on https://github.com/daylerees/laravel-website-configs/blob/6db24701073dbe34d2d58fea3a3c6b3c0cd5685b/nginx.conf and seemed to be necessary to get Laravel working.
server_name mysite.local;
# The location of our project's public directory.
root F:/code/mysite/public/;
# Point index to the Laravel front controller.
index index.php;
location / {
# URLs to attempt, including pretty ones.
try_files $uri $uri/ /index.php?$query_string;
} …Run Code Online (Sandbox Code Playgroud) 我和我的朋友有一个网站(http://www.ferfereh.ir - 抱歉不是英文)一年.我们一直在使用安装了wordpress的Linux Apache主机.现在,我们所有的帖子(有永久链接结构= /%category%/%postname%.html)突然爆发并说:
nginx的
也许我们的主机提供商安装了NginX.我不知道Nginx到底是什么,但我在某处读到它与.htaccess配置有一些冲突,这使得我们永久链接,是的.
我该怎么办?
非常感谢