views:

18

answers:

3

i have used the following code in .htaccess

Options +FollowSymlinks
RewriteEngine On 
RewriteBase /
RewriteRule ^company/aboutus$ aboutus.php  [NC,L]
RewriteRule ^company/contactus$ contactus.php  [NC,L]
RewriteRule ^company/careers$ careers.php  [NC,L]
RewriteRule ^/$ index.php  [NC,L]

the above code works but aboutus page loading without any css and images. no company folder, i have used company word for url redability

A: 

Because you're using relative paths and now the browser thinks the CSS is somewhere it's not. You'll have to update your links or move your CSS files to the level the browser thinks it's at. You could also set a base href but I don't recommend that as it can cause confusion down the track.

SpliFF
A: 

Well, it sounds like the problem is that the HTML you are outputting probably refers to relative paths relative to /, and not company/. You could use absolute paths or do something like this in your HTML:

<base href = "{your base url}" />
Sasha
+1  A: 

This is because the browser is trying to lookup your stylesheet in /company. Use an absolute URL when linking rewritten files (e.g. /styles.css) or use the HTML <base> tag to specify from where the URLs should be resolved.

Max Shawabkeh