简体   繁体   中英

When i point my browser to website site.com/index.php/“non-existent-dir” shows index.php the page with no css

Here is my .htaccess file:

ErrorDocument 404 /404.html
Options +FollowSymlinks
Options -Indexes


RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

no css styles applied

I dont want the page to show at all... is it not supposed to show te 404 page i configured?

index.php/ is not a directory

It is because you are not using absolute path for your style/image href and src.

<link rel="stylesheet" type="text/css" href="/design/style.css"/>
<img src="/design/mylogo.php"/>

As you can see I have added / in front of a path, so I am pointing browser to search for a file in a root location. When you are on url http://example.com/index.php/somename browser is trying to find css/images on this location http://example.com/index.php/somename/design/style.css or http://example.com/index.php/somenamde/design/mylogo.png .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM