theme development - Disable redirect canonical

I am trying to prevent index.php from redirecting to a file index.html which I also have in the home directory. I want i

I am trying to prevent index.php from redirecting to a file index.html which I also have in the home directory. I want index.html to remain there for a few days until the WordPress site is finished, being the page that visitors will see, and I'd access the new installation by adding index.php to the url; but WordPress redirects index.php to index.html meaning that I can only view the pages and posts and not the home page. I have tried putting remove_filter('template_redirect', 'redirect_canonical'); into the functions.php file but it doesn't work.

I am trying to prevent index.php from redirecting to a file index.html which I also have in the home directory. I want index.html to remain there for a few days until the WordPress site is finished, being the page that visitors will see, and I'd access the new installation by adding index.php to the url; but WordPress redirects index.php to index.html meaning that I can only view the pages and posts and not the home page. I have tried putting remove_filter('template_redirect', 'redirect_canonical'); into the functions.php file but it doesn't work.

Share Improve this question edited Jul 23, 2019 at 13:47 the 1,5682 gold badges13 silver badges32 bronze badges asked Oct 13, 2011 at 15:02 byronyasgurbyronyasgur 3,0624 gold badges35 silver badges54 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

Try adding this to your .htaccess file:

RewriteRule ^index\.htm$ index.php [NC,R]

SOURCE: http://css-tricks/377-how-to-redirect-indexhtml-to-indexphp/

Found the problem - you have to access index.php/ not just index.php

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745302187a4621501.html

相关推荐

  • theme development - Disable redirect canonical

    I am trying to prevent index.php from redirecting to a file index.html which I also have in the home directory. I want i

    7小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信