RewriteBase だとパスがずれるので 変数で対応する
でも動いてなさ気。 試行錯誤中
RewriteBase /
SetEnvIfNoCase Request_URI closed_test pppp=test/
#Maintenance
#RewriteCond %{REMOTE_ADDR} !^000.000.000.000
#RewriteRule .* mt\.html [L]
#RewriteRule 一部ファイル mt\.html [L]
RewriteRule ^%{ENV:pppp}tmp – [L]
スマホページからpcへ切替
# get UserAgent
SetEnvIfNoCase User-Agent “iPhone” UA=sp
SetEnvIfNoCase User-Agent “iPod” UA=sp
SetEnvIfNoCase User-Agent “Android.*Mobi” UA=sp
SetEnvIfNoCase User-Agent “Windows Phone” UA=sp
SetEnvIfNoCase User-Agent “Mobi.*Firefox” UA=sp
SetEnvIfNoCase User-Agent “(Nexus 4|Nexus 5|Nexus 6)” UA=sp
SetEnvIfNoCase User-Agent “BlackBerry” UA=sp
SetEnvIfNoCase User-Agent “WebOS” UA=sp
SetEnvIfNoCase User-Agent “Opera Mini” UA=sp
SetEnvIfNoCase User-Agent “Opera sp” UA=sp
# Redirect if smart phone
RewriteCond %{ENV:UA} sp
RewriteCond %{HTTP_COOKIE} !viewmode=pc [NC]
RewriteCond %{REQUEST_URI} !/%{ENV:pppp}sp/.*
RewriteCond %{REQUEST_URI} ^/%{ENV:pppp}$
RewriteRule ^.*$ /%{ENV:pppp}sp/ [R,L]
pathがないと階層次第でうまく動かない
$(function()
{
$(‘.js_set_viewmode’).on(‘click’, function()
{
$.cookie(‘viewmode’, ‘pc’, { path: “/” });
});
});