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]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?