Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CSS][PHP]RewriteRule gubi CSS'a
Ubermade
post
Post #1





Grupa: Zarejestrowani
Postów: 38
Pomógł: 0
Dołączył: 30.11.2017
Skąd: Leszno, Poland

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


Witam! Ostatnio postanowiłem zoptymalizować linki za pomocą RewriteRule, jednak napotkałem bardzo dziwny błąd.
Napisałem prosty silnik, który bezpośrednio linkuje CSS'a do szablonu, w którym do diva ładowany jest cały kontent strony
  1. <?php
  2. require_once 'utilities/connect.php';
  3. require_once 'utilities/location.php';
  4.  
  5. if(isset($_GET['module'])){
  6. $module = $_GET['module'];
  7. }else{
  8. $module = 'home';
  9. }
  10.  
  11. $moduleDir = 'modules/'.$module.'.php';
  12. $cssDir = 'styles/';
  13. $imagesDir = 'images/';
  14.  
  15. if(file_exists($moduleDir)){
  16. require_once ($moduleDir);
  17. $content = ob_get_contents();
  18.  
  19. require_once ('layouts/basic.php');
  20. }else {
  21. header("HTTP/1.0 404 Not Found");
  22. echo '404';
  23. }

Gdy próbuję wejść pod adres index.php?module=edit_category&id=<id> to wszystko działa, jednak, gdy próbóję wejść tam za pomocą RewriteRule

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule home index.php
RewriteRule home index.php?module=home
RewriteRule about-me index.php?module=about_me
RewriteRule my-works index.php?module=my_works
RewriteRule contact index.php?module=contact
RewriteRule list-of-categories index.php?module=list_of_categories
RewriteRule add-category index.php?module=add_category
RewriteRule ^delete-category/([^-]+)$ index.php?module=delete_category&id=$1
RewriteRule ^edit-category/([^-]+)$ index.php?module=edit_category&id=$1
RewriteRule admin index.php?module=admin
RewriteRule panel index.php?module=panel
RewriteRule logout index.php?module=logout

to mimo, że wszystkie działania działają bez zarzutu, to css się niestety nie wczytuje :/
Z góry dziękuję za pomoc (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 15.09.2025 - 02:24