.htaccess - Welcome page before WordPress (sub directory install) -
i installed wordpress sub directory:
example.com/wp
i use rewrite rule serve wordpress root uri:
example.com
# 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
- i want provide welcome page project launch:
example.com/welcome.html
it have simple welcoming message , should redirect working version of wordpress. have pretty urls enabled in wordpress. welcome.html
page can link example.com/about
, example, , show page of wordpress (as expected).
however, cannot link home page of wordpress. use static page wordpress front page (let's call start
). when link example.com/wp
, issue error 404 in wordpress. when link example.com/start
, redirect welcome.html
page.
sounds confusing? hope still me. want:
a) users directly access example.com
should see welcome page.
b) click link on welcome page , wordpress home.
c) when navigating within wordpress, should not redirected welcome page.
since want remove welcome page after couple of weeks, want keep simple possible (no new front page template wordpress or alike).
is there solution set welcome.html
directoryindex
, make other requests redirect wordpress installation including wordpress home? major problem cannot access wordpress home page right (neither example.com/wp
, nor example.com/start
or example.com/wp/start
work), unlike other static page (example.com/about
works fine).
i ended using one-line plugin disable canonical url redirects:
<?php remove_filter('template_redirect', 'redirect_canonical'); ?>
furthermore, reconfigured wordpress uri on general settings panel. can both, call home page of blog , access sub-pages, without being redirected error 404.
now i'll have .htaccess
directoryindex welcome.html
, visitors see splash page first. welcome page has link index.php
page serves wordpress. links within blog work.
when project launched, remove directoryindex
, delete above plugin code , reset general settings.
Comments
Post a Comment