JohnnyHobart JohnnyHobart - 9 months ago 62
Apache Configuration Question

Redirect Wordpress homepage to subpage

I have created a Wordpress directory within an AWS EC2 instance. I would like to redirect just the homepage to 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!

Answer Source

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]