S
S
Sergey Chi2014-06-11 14:35:27
htaccess
Sergey Chi, 2014-06-11 14:35:27

How to implement rules for urls with slashes in htaccess?

Essence of the question: I have a site http://site.com that looks at the index.php root file.
I need any url like:
site.com/url1
site.com/someurl
site.com/blablabla
...
look to index.php, provided that there is no folder with the same name in the root. And if there is such a folder, then accordingly, so that this rule does not work.
Is it possible to somehow write this as a RewriteRule directive in .htaccess or something else?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vit, 2014-06-11
@fornit1917

Can. The essence is this:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

S
Sergey Chi, 2014-06-12
@sergeychi3

I tried, I registered the following in .htaccess:

AddDefaultCharset windows-1251

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php

but at tesla-wave.ru/buy it displays the following:
The requested URL /i was not found on this server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question