The image cannot be displayed after the. htaccess redirection is used, and CSS becomes invalid. how can this problem be solved?

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.