我正在建立一个新的网站并且在使用htaccess之前有很多帮助,以使其全部工作。然而,我无法再访问网站www.placewomen.com的根源了...当我看到root的index.html时,它正在寻找/ c / c ....我的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]
答案 0 :(得分:0)
试试这段代码:
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} -d
RewriteCond %{REQUEST_FILENAME}/placeholder.jpg -f
RewriteRule ^(.*)$ /$1/placeholder.jpg [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [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]
RewriteRule ^(.+)$ /new/index.php?var=$1 [QSA,L]