WordpressまたはIndexhibitのいずれかを使用してサイトを管理するクライアント向けに「シンプルな」リダイレクトを作成しようとしています。
ドメインを入力して、それぞれの管理領域にリダイレクトできるように設定しました(多くの人が忘れていることに驚いていますが、これが私の解決策です)
単一のリダイレクトで正常に機能しましたが、以前のSO送信の裏で、if / elseifを使用して両方を統合しようとしましたが、解析に失敗しました。
私が間違ったことをしたアイデア/大いに感謝するのに役立ちます!
<?php
if ($_POST['indexhibit_url']) {
if($_SERVER['REQUEST_METHOD'] == 'POST') : $indexhibit_url = $_POST['indexhibit_url']; header('Location: http://' . $indexhibit_url . '/ndxz-studio/');
}
elseif ($_POST['wordpress_url']) {
if($_SERVER['REQUEST_METHOD'] == 'POST') : $wordpress_url = $_POST['wordpress_url']; header('Location: http://' . $wordpress_url . '/wp-admin/');
}
?>
<form action="<?php echo $_SERVER['../PHP_SELF']; ?>" method="post" name="indexhibit_url">
<h3>Indexhibit</h3>
<p class='formp'>If your website is powered by <em>Indexhibit</em> submit your URL to be forwarded to your admin area</p>
<input class='loginforms' type="text" value='i.e. your-domain-name.com' onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'i.e. your-domain-name.com':this.value;" name="indexhibit_url" />
<input class="btn btn-info loginbuttons" name="index_submit" type="submit" value="Go" />
</form>
<form action="<?php echo $_SERVER['../PHP_SELF']; ?>" method="post" name="wordpress_url">
<h3 style='margin-top:2em;'>Wordpress</h3>
<p class='formp'>If your website is powered by <em>Wordpress</em> submit your URL to be forwarded to your admin area</p>
<input class='loginforms' type="text" value='i.e. your-domain-name.com' onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'i.e. your-domain-name.com':this.value;" name="wordpress_url" />
<input class="btn btn-info loginbuttons" name="wp_submit" type="submit" value="Go" />
</form>
<?php endif; ?>