dsxrq28228 2016-10-18 17:29
浏览 89
已采纳

将Wordpress主页重定向到子页面

I have created a Wordpress directory within an AWS EC2 instance. I would like to redirect just the homepage www.website.com to www.website.com/landing without breaking the rest of the site.

I've tried the answers to many similar questions within stackflow but cannot seem to get it to work properly.

I have attempted editing the .htaccess file within bitnami/apps/wordpress/htdocs. The current .htaccess code is as follows:

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

</IfModule>

# END WordPress

As stated, I've tried many other suggestions without success. Should I be making changes to a different .htaccess file? Have I just not used the proper rule? If so, what is the proper rule?

I apologize for my ignorance here, thanks for taking a look!

  • 写回答

1条回答 默认 最新

  • dongyakui8675 2016-10-18 17:52
    关注

    I believe that ^$ matches the root of a host. Try adding this to the top of your .htaccess file.

    RewriteEngine On
    RewriteRule ^$ /landing [R,L]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法