.htaccess tutorial

htaccess Elite


Please Help me !!!!!!

Ask your mod_rewrite and Redirection questions here, and get answers!

Please Help me !!!!!!

New postby alwinaugustiniphp » 09 Feb 2009 12:05



I have to redirect http://www.mysite.com/blog.html to http://www.mysite.com/blog/ ,and I have done the following code in .htaccess:

Options +FollowSymlinks
RewriteEngine on

RewriteRule blog.html /blog/


Now ,the redirection is working. But there is a distortion in the blog layout.The font size get increased and the background image is showing only for the half of the page and the other half fas got the white background.

How can I fix this??I have tried by giving full path to the CSS and image files.But it is not working....The site is live and so I need some urgent fix.

Could anyone help me???

alwinaugustiniphp
 
Posts: 2
Joined: 09 Feb 2009 11:54

Re: Please Help me !!!!!!

New postby bmn » 12 Feb 2009 00:38

If your browser points to http://www.mysite.com/blog.html then any relative links will be to the root of the domain, i.e.
Code: Select all
<img src="foo.jpg" />
is actually calling
Code: Select all
<img src="http://www.mysite.com/foo.jpg" />


So this means that if you've redirected everyone to http://www.mysite.com/blog/ then /blog becomes the base for relative links, so the the example above would instead reference
Code: Select all
<img src="http://www.mysite.com/blog/foo.jpg" />

And this file may not exist.

From what you've described this sounds like what's going on, i.e. some image or CSS files are incorrectly relatively referenced.

Hope this helps.
bmn
 
Posts: 1
Joined: 12 Feb 2009 00:22

Re: Please Help me !!!!!!

New postby alwinaugustiniphp » 12 Feb 2009 06:24

Okay..Thank you..for your reply..actually I am trying the same..
alwinaugustiniphp
 
Posts: 2
Joined: 09 Feb 2009 11:54


Return to Redirect or Rewrite Questions