AddDefaultCharset utf-8 php_value max_execution_time 120 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([A-Za-z0-9_-]+)/page/([0-9]+)$ index.php?category=$1&page=$2 [L] RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ index.php?category=$1&zapros=$2 [L] RewriteRule ^([A-Za-z0-9_-]+)$ index.php?category=$1 [L] 

In general, when I turn to site.ru/category/page/2 then the styles and images are not shown, what should I do?

    1 answer 1

    Yes, everything works, just if I wrote an error 404, for example, then it would not work. ;) Read again carefully the article about the CNC, there this nuance is described.

    You need to check the paths of styles and images in all templates and output to the browser. now you have all this set in a relative way, and therefore does not work. you need to fix it like this: it was:

     <link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" /> 

    It became:

     <link rel="stylesheet" type="text/css" media="screen" href="/css/screen.css" /> 

    Well, the same thing with the pictures. in the first example, just going to site.ru/category/page/2 browser will search for css/screen.css along the path site.ru/category/page/2/css/screen.css

    You can see this if you turn on, for example, firebug and see where it cannot load a picture or style from.

    • Do I now have to change the whole site? - jacob
    • yeah or add a bit of htaccess so that when requesting *.css it *.css it from the root of the site as you entered index.php. Well, with the same picture ... - thunder
    • put firebug and look what it requests and which way. so it will be easier to assess what and where to change. - thunder
    • yeah or add a little .htaccess so that when requesting * .css it takes it from the root of the site as you entered index.php. Well, with the same picture ... but how to do it? - jacob
    • Well, for example, <FilesMatch "\. (htm | php | js | css | htc | png | gif | jpe? g | ico | xml | csv | txt | swf | flv | eot | woff | svg | ttf | pdf | gz) $ "> RewriteEngine Off </ FilesMatch> - thunder