さくらサーバーのhtaccessファイルのリダイレクト設定
Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /home/himariweb/www/wp/wp-content/themes/luxeritas/inc/wpfunc.php on line 1921
Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /home/himariweb/www/wp/wp-content/themes/luxeritas/inc/wpfunc.php on line 1921
Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /home/himariweb/www/wp/wp-content/themes/luxeritas/inc/wpfunc.php on line 1921
Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /home/himariweb/www/wp/wp-content/themes/luxeritas/inc/wpfunc.php on line 1921
独自ドメインを取得してそのドメインでブログを表示できるようにしました。
でも、sakura.ne.jpでのアクセスもそのままだったのでhimariweb.comにリダイレクトするようにします。
ディレクトリ構造はWordPressをインストールした場所によって変わります。
ディレクトリ構造
├ www
│ └ wp
│ ├ wp-admin
│ ├ wp-content
│ ├ wp-include
│
├ .htaccess // これを編集
htaccessの編集
BEGIN WordPressの上にさくらのサポート情報のコードをいれます。〇〇〇の箇所は自分のサイトURLに変更します。
リダイレクトコードを別のファイルに書いたり、BEGIN WordPressの最後に追加したりして動かなく結構悩みました。
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?[^.]+\.sakura\.ne\.jp$ [NC]
RewriteRule .* http://○○○.com%{REQUEST_URI} [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
ディスカッション
コメント一覧
まだ、コメントがありません