Use. the image cannot be displayed after the htaccess redirection. CSS becomes invalid. There are three subdirectories under the root directory of my website, which are bound to different host names under the same domain name and under the root directory respectively through htaccess. the specific content of htaccess is as follows: & nbsp; & lt; IfModulemod_rewrite.c & gt; & nbsp; RewriteEngineOn & nbsp; RewriteCond % {HTTP. the image cannot be displayed after the htaccess redirection, and the CSS is invalid.
There are three subdirectories under the root directory of my website, which are respectively bound to different hostnames under the same domain name through htaccess. the specific content of. htaccess under the root directory is as follows:
RewriteEngine On
RewriteCond % {HTTP_HOST} ^ (www \.)? Mydomain \. org $
RewriteCond % {REQUEST_URI }! ^/Wp/
RewriteCond % {REQUEST_FILENAME }! -F
RewriteCond % {REQUEST_FILENAME }! -D
RewriteRule ^ (. *) $/wp/$1
RewriteCond % {HTTP_HOST} ^ (www \.)? Mydomain \. org $
RewriteRule ^ (/)? $ Wp/index. php [L]
RewriteCond % {HTTP_HOST} ^ (bbs \.)? Mydomain \. org $
RewriteCond % {REQUEST_URI }! ^/Bbs/
RewriteCond % {REQUEST_FILENAME }! -F
RewriteCond % {REQUEST_FILENAME }! -D
RewriteRule ^ (. *) $/bbs/$1
RewriteCond % {HTTP_HOST} ^ (bbs \.)? Mydomain \. org $
RewriteRule ^ (/)? $ Bbs/index. php [L]
RewriteCond % {HTTP_HOST} ^ (blog \.)? Mydomain \. org $
RewriteCond % {REQUEST_URI }! ^/Blog/
RewriteCond % {REQUEST_FILENAME }! -F
RewriteCond % {REQUEST_FILENAME }! -D
RewriteRule ^ (. *) $/blog/$1
RewriteCond % {HTTP_HOST} ^ (blog \.)? Mydomain \. org $
RewriteRule ^ (/)? $ Blog/index. php [L]
Now I need to resolve this domain name to the blog directory (* .mydomain.org) without changing the resolution of the other two directories. After you try to make the following changes to the last section (the previous content remains unchanged), a problem occurs: the images in the other two directories cannot be displayed, and CSS is all invalid.
Modify as follows:
RewriteCond % {HTTP_HOST} ^ (.*\.)? Mydomain \. org $
RewriteCond % {REQUEST_URI }! ^/Blog/
RewriteCond % {REQUEST_FILENAME }! -F
RewriteCond % {REQUEST_FILENAME }! -D
RewriteRule ^ (. *) $/blog/$1
RewriteCond % {HTTP_HOST} ^ (.*\.)? Mydomain \. org $
RewriteRule ^ (/)? $ Blog/index. php [L]
The programs installed in each directory are:
\ Bbs Discuz
\ Blog Supersite + S-Space
\ Wp WordPress
Can someone help solve this problem? Of course, I mean using htaccess. My site is on a virtual host and can only be implemented using this method.
Thank you!
------ Solution --------------------
Http://phprimer.com/viewtopic.php? F = 23 & t = 453
I found my mistake above. to make up for it, I found an article for you, hoping it will be useful to you!
------ Solution --------------------
Let me give you an example. For more information, see
RewriteRule! \. (Js | ico | gif | jpg | png | css) $/wp/$1
RewriteRule ^ (. *) $/wp/$1