2016-10-18 17:29
浏览 89


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]


# 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!

图片转代码服务由CSDN问答提供 功能建议

我在AWS EC2实例中创建了一个Wordpress目录。 我想将主页www.website.com重定向到www.website.com/landing而不会破坏网站的其他部分。

我已经尝试过很多类似问题的答案 在stackflow中但似乎无法使其正常工作。

我尝试在bitnami / apps / wordpress / htdocs中编辑.htaccess文件。 当前.htaccess代码如下:

  #BEGIN WordPress 
&lt; IfModule mod_rewrite.c&gt; 
RewriteEngine On 
RewriteBase / 
RewriteRule ^ index \ .php $  -  [  L] 
RewriteRule。  /index.php [L] 
&lt; / IfModule&gt; 
 #END WordPress 

如上所述,我已尝试了许多其他建议 成功。 我应该更改其他.htaccess文件吗? 我刚刚没有使用正确的规则吗? 如果是这样,那么适当的规则是什么?


  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

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]
    解决 无用
    打赏 举报

相关推荐 更多相似问题