M
M
Memorivardo2015-11-03 17:38:57
PHP
Memorivardo, 2015-11-03 17:38:57

How to write a rule in htaccess so that all paths lead to index?

The essence of the trouble (I did it 50 times, today I’m stupid to eerily):
There is a directory structure, for example:
/index.php
/.htaccess
/backend/ ....
/frontend/ ....
/images/ ....
etc. d.
My htaccess has the following theme:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php [L,QSA]
</IfModule>

Accordingly, all urls in the style of site.ru/asdkjaskdjasd/sadkjasd/asdasd and the like happily go to the root index.php. But here the url site.ru/backend/ climbs into the backend folder. Question: how to fix this situation?
Note: these folders contain files (css, js, jpg and the like), which should still be available via links in the style site.ru/backend/css/****.css, etc.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2015-11-03
@Memorivardo

Remove RewriteCond %{REQUEST_FILENAME} !-d.

L
LittleFatNinja, 2015-11-03
@LittleFatNinja

why css js is not in the frontend folder?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question