dongshi6529 2015-12-21 17:14
浏览 83
已采纳

404当WordPress在子文件夹中时

I know this question often comes up but none of the answers is satisfactory for me. I tried everything I could find on the web nothing works.

1 - I installed my Wordpress in a sub folder /folder/wp.

2 - I moved .htaccess and index.php to the root ( given by WordPress )

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /folder/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /folder/index.php [L]
</IfModule>
# END WordPress

3 - I changed index.php like this:

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );

4 - I changed WordPress url: http://localhost/folder/wp

5 - I kept site url: http://localhost/folder

Without Permalinks, everything works. As soon as I turn on permalinks, I have a 404

There are some things I do not understand:

1 - Why keep index.php and .htaccess in the sub folder?

2 - Some say to add /wp in RewriteBase and RewriteRule in .htaccess at the root, but it does not change?

I read dozens of Post and nothing works for me. Has anyone ever faced this problem?

thank you very much

  • 写回答

1条回答 默认 最新

  • drxm72811 2015-12-22 13:02
    关注

    Something that is not thought is to ensure that the Apache mod_rewrite module is enabled. There are dozens of tutorials on Wordpress installation in a sub folder but none specifies that. I hope this can help.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧