EC-CUBEで静的URL

httpd.conf の確認
・LoadModule rewrite_module modules/mod_rewrite.so
・AllowOverride All
AllowOverride がAllになっていないことが多い
この2箇所に注意

”.htaccess”のサンプル

#mode_rewriteの設定
RewriteEngine on
RewriteBase /demo/hogehoge.jp/   // EC-CUBEのルートディレクトリ
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^products/detail/([0-9]+)? products/detail.php?product_id=$1 [L]
RewriteRule ^products/list/([0-9]+)? products/list.php?category_id=$1 [L]
RewriteRule ^mobile/products/detail/([0-9]+)_([0-9]+)? mobile/products/detail.php?product_id=$1&page=$2 [L]
RewriteRule ^mobile/products/list/([0-9]+)? mobile/products/list.php?category_id=$1 [L]

例(2)examle.com

#mode_rewriteの設定
RewriteEngine on
RewriteBase /demo/examle.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^products/detail/([0-9]+)? products/detail.php?product_id=$1 [L]
RewriteRule ^products/list/([0-9]+)? products/list.php?category_id=$1 [L]
RewriteRule ^mobile/products/detail/([0-9]+).html? mobile/products/detail.php?product_id=$1 [L]
RewriteRule ^mobile/products/list/([0-9]+).html? mobile/products/list.php?category_id=$1 [L]

コメントを残す