调用http://www.placewomen.com/500/400/
时,是否可以显示http://www.placewomen.com/c/500/400/
的内容,这样会使c消失?
有点棘手,因为还检查了一个空子,并且物理上新的url-rewrite不存在......
现在这是我的htaccess;
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} ^placewomen.com [NC]
RewriteRule ^(.*)$ http://www.placewomen.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} \s/+new/index\.php\?var=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /new/index.php?var=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME}/placeholder.jpg -f
RewriteRule ^(.*)$ /$1/placeholder.jpg [L]
我自己也是一个前卫,所以也许你会明白这是我的知识背后......
答案 0 :(得分:0)
您可以使用此规则隐藏文件夹c
:
RewriteRule !^c/ /c%{REQUEST_URI} [L,NC]
答案 1 :(得分:0)
尝试添加此内容:
RewriteCond %{DOCUMENT_ROOT}/c/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/c/$1 -d [OR]
RewriteCond %{DOCUMENT_ROOT}/c/$1 -l
RewriteRule ^(.*)$ /c/$1 [L]
在你的htaccess文件中间:
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} ^placewomen.com [NC]
RewriteRule ^(.*)$ http://www.placewomen.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} \s/+new/index\.php\?var=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=301,L]
RewriteCond %{DOCUMENT_ROOT}/c/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/c/$1 -d [OR]
RewriteCond %{DOCUMENT_ROOT}/c/$1 -l
RewriteRule ^(.*)$ /c/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /new/index.php?var=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME}/placeholder.jpg -f
RewriteRule ^(.*)$ /$1/placeholder.jpg [L]