Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]nie wczytuje css
Michał90
post
Post #1





Grupa: Zarejestrowani
Postów: 267
Pomógł: 0
Dołączył: 16.05.2007

Ostrzeżenie: (0%)
-----


Witam,
Otóż na stronie głównej strona działa OK, ale jak chce przejść do jakiejś podstrony np.
adres.pl/test/

To już tak jakby nie widział styli.css dlaczego?

test/ jest dodany w htaccess czyli główny plik to np. test.php

Jak to naprawić?
I jak zrobić, żeby po wpisaniu adresu np. adres.pl/test strona również działała, a nie tylko jak jest "/" na końcu

Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 8)
krzysztof_kf
post
Post #2





Grupa: Zarejestrowani
Postów: 1 135
Pomógł: 158
Dołączył: 19.03.2009
Skąd: Toruń

Ostrzeżenie: (0%)
-----


a masz dodany ?

  1. <link rel="stylesheet" type="text/css" href="style.css" />

Go to the top of the page
+Quote Post
Michał90
post
Post #3





Grupa: Zarejestrowani
Postów: 267
Pomógł: 0
Dołączył: 16.05.2007

Ostrzeżenie: (0%)
-----


Tak mam
Go to the top of the page
+Quote Post
minolone
post
Post #4





Grupa: Zarejestrowani
Postów: 141
Pomógł: 24
Dołączył: 21.06.2008

Ostrzeżenie: (0%)
-----


Pokaż swój index, test i .htaccess, nikt tego nie widzi dlatego nie ma jak ci pomóc.
Go to the top of the page
+Quote Post
krzysztof_kf
post
Post #5





Grupa: Zarejestrowani
Postów: 1 135
Pomógł: 158
Dołączył: 19.03.2009
Skąd: Toruń

Ostrzeżenie: (0%)
-----


To załaduj style po przez adres ?

  1. <link rel="stylesheet" type="text/css" href="http://adres.pl/style.css" />
Go to the top of the page
+Quote Post
Michał90
post
Post #6





Grupa: Zarejestrowani
Postów: 267
Pomógł: 0
Dołączył: 16.05.2007

Ostrzeżenie: (0%)
-----


index.html
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Index</title>
  5. <link rel="stylesheet" type="text/css" href="style.css" />
  6.  
  7. </head>


test.php
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Test</title>
  5. <link rel="stylesheet" type="text/css" href="style.css" />
  6.  
  7. </head>


.htaccess
Kod
RewriteEngine on


RewriteRule ^index.html$ index.php [L]
RewriteRule ^test/$ test.php [L]
Go to the top of the page
+Quote Post
minolone
post
Post #7





Grupa: Zarejestrowani
Postów: 141
Pomógł: 24
Dołączył: 21.06.2008

Ostrzeżenie: (0%)
-----


dodaj do pliku test.php,
a dokładniej tutaj
  1. <link rel="stylesheet" type="text/css" href="style.css" />

przed style.css "../"
czyli ma wyglądać tak
  1. <link rel="stylesheet" type="text/css" href="../style.css" />


Ten post edytował minolone 29.04.2010, 22:54:09
Go to the top of the page
+Quote Post
Michał90
post
Post #8





Grupa: Zarejestrowani
Postów: 267
Pomógł: 0
Dołączył: 16.05.2007

Ostrzeżenie: (0%)
-----


A jak zrobić, żeby po wpisaniu adresu np. adres.pl/test strona również działała?
Teraz tylko działa jak jest "/" na końcu np. adres.pl/test/
Go to the top of the page
+Quote Post
krzysztof_kf
post
Post #9





Grupa: Zarejestrowani
Postów: 1 135
Pomógł: 158
Dołączył: 19.03.2009
Skąd: Toruń

Ostrzeżenie: (0%)
-----


  1.  
  2. RewriteRule ^test$ test.php [L]


Ten post edytował krzysztof_kf 30.04.2010, 10:50:16
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 12:51