Answer the question
In order to leave comments, you need to log in
How to correctly generate RewriteCond in hcaccsess for a specific folder?
Good afternoon!
The structure is the following site.com/dbtest
how to make links like site.com/dbtest/someURL - i.e. non-existing folders were
redirected for processing to site.com/dbtest/blog.php
RewriteEngine On
RewriteCond %{dbtest/REQUEST_FILENAME} !-f #Если файл не существует
RewriteCond %{dbtest/REQUEST_FILENAME} !-d #И если папка не существует
RewriteRule ^.*$ dbtest/blog.php [QSA,L]
Answer the question
In order to leave comments, you need to log in
You obviously have something extra: dbtest/REQUEST_FILENAME
Try .htaccess in the dbtest folder (will be for all links from dbtest):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ blog.php [L]
</IfModule>
you can use PHP Cookie php.net/manual/ru/function.setcookie.php
or jQuery plugin jQuery.cookie plugins.jquery.com/cookie
And when loading the page, if there is something in the Cookie, then display it in this form
document.cookie = "userName=Vasya";
and if you don't know what to do with it - freelansim.ru
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question