0

Ok so after many false attempt I was able to get hold of the redirects, now the CSS file was not getting the path, previously the path was

Directory Structure

<base>
   <stylesheets>
      default.css
   </stylesheets>
   home.php
   .htaccess file
</base>

localhost/my_website/stylesheets/default.css

And I used to write this as

<link href="stylesheets/core.css" rel="stylesheet" type="text/css" />

in home.php

But after url rewrite the path was lost in home.php, it was assuming the stylesheet folder is like

home/stylesheets/core.css

So I changed it manually to

<link href="../stylesheets/core.css" rel="stylesheet" type="text/css" />

And it worked, so does this mean I need to change each and every URL like this?

Also do I need to change the header() paths too? Right now they are like

header('Location: home.php?page=dashboard');

To

header('Location: home/?page=dashboard');
Random Guy
  • 2,878
  • 5
  • 20
  • 32
  • possible duplicate of [CSS styles disappear if I type an argument after index.php](http://stackoverflow.com/questions/9272944/css-styles-disappear-if-i-type-an-argument-after-index-php) – mario Jan 06 '13 at 13:50
  • @mario that's not only about the CSS, even my header redirects are not working so do I need to change the paths? – Random Guy Jan 06 '13 at 13:52
  • @mario any answers mario? – Random Guy Jan 06 '13 at 13:57
  • Don't put two unrelated questions in one. Also there are more duplicates to look at. – mario Jan 06 '13 at 14:29

2 Answers2

0

You could use absolute paths for your css and images.

/stylesheets/core.css

Or you could use base html tag.

I am not sure about redirect paths though.

Community
  • 1
  • 1
Sergejs Rižovs
  • 458
  • 1
  • 4
  • 11
0
header('Location: home/dashboard/');

This can be used if you have made changes in the .htaccess for the values like

.htaccess

RewriteRule ^(.*)$ home.php?page=$1 [L,QSA]

if you have the above code in your .htaccess then you can use the top suggested code.

Hope this helps

Utsav
  • 1
  • 2