たこ坪

私はタコになりたい

.htaccess php サーバー

sakuraサーバーで.htaccessで静的ページにする

投稿日:

sakuraサーバーで
phpを静的ページにする
検索エンジン対策にSEO的には必須だろう

.htaccessにて


RewriteEngine on
RewriteBase /
RewriteRule ^([0-9a-zA-Z]+)/$ nannen/index.php [L]
RewriteRule ^([0-9a-zA-Z]+)/$ index.php?q=$1 [L]

今年は2017何年平成29年
な感じ

クエリが複数ある場合など
phpのpath infoを使うのもありでぇす
サクラサーバーの静的ページは
クエリたくさんあるとめんどくせー

-.htaccess, php, サーバー
-

執筆者:


comment

メールアドレスが公開されることはありません。

関連記事

no image

phpMyAdminでLatin1の文字化けをUTF8に直す

共用のレンタルサーバーでMySQLのphpMyAdminでdumpしたデータが文字化けでデータ移行できない。 Mysqlの文字コードがLatin1で文字化けでなに書いてあるのかわからない 仕方ないから …

GeoIP2 IPアドレスから都道府県情報取得

GEOIP無料版 まずは http://dev.maxmind.com/ja/geolite2/ から GeoLite2 City GeoLite2 Country % gunzip GeoLite2 …

no image

サクラサーバーでSSL(https://)にする

.htaccessにて以下のコード記入する RewriteEngine on RewriteCond %{HTTP:X-Sakura-Forwarded-For} ^$ RewriteRule ^(. …

no image

phpでランダムな文字列をつくる

パスワードどとかに使うランダム文字列 phpでランダムな文字列をつくるには str_shuffleを使う <?php function random($length = 24) { return …

no image

エラー表示 .htaccess とphp 

.htaccessの場合 エラー出力しない php_flag display_errors “off” エラー出力する php_flag display_errors “on” .htaccessの場 …