I am using codeigniter.
My products page shows all the products we have and then users can click on each product_name to get more details about that particular product. So, I have declared products as the class and product_name as a function within the product class – so I could get the url http://www.company.com/products/product_name.
When I go to http://www.company.com/products everything is fine but if I add a trailing slash so it looks like http://www.company.com/products/ my window underneath the logo and menu moves over it hiding both the logo and menu. The same happens when I go to http://www.company.com/products/product_name.
How can I make sure that the window below does not hide when I add trailing slashes or when I go to product_name pages.
Any help would be appreciated.
The problem is that you have specified a relative path for your images. You need to make them absolute, or at least relative to the current location. That is to say, if you change your image path from:
to
Your problem will be solved.
The reason this is happening is because the path to the images is determined by the base URL. When you are at
http://www.obsia.comorhttp://www.obsia.com/products, your base URL ishttp://www.obsia.com.To the browser then
images/obsia.pngis rendered ashttp://www.obsia.com/image/obsia.png, which your server interprets aswwwroot/images/obsia.pngand the relative link works.However, if you do
http://www.obsia.com/products/your base url ishttp://www.obsia.com/productsand the relative path for your images changes fromhttp://www.obsia.com/images/obsia.pngtohttp://www.obsia.com/products/images/obsia.png.Your server interprets this as , which your server interprets as
wwwroot/images/products/obsia.png, which is not a valid path. The server returns a 404 –resulting in broken images.You can see this if you use Firebug’s .Net panel. The request for your logo returns: