F
F
Fithanso2019-07-31 18:55:03
htaccess
Fithanso, 2019-07-31 18:55:03

Write condition in htaccess?

Don't throw tomatoes!
I am not familiar with the htaccess setting, but then I will definitely read what's what there.
Please help me because I don't have much time.
So, there is initially a file, it says:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L] REQUEST_URI

Please explain why there is a regular expression after RewriteRule, and what does $1 mean after index.php. And what effect does the condition give as a result.
You need to do this: leave the original condition, but add such that if the url after the site name is admin (that is, sitename/admin/), then redirect to the following address: sitename/folder . In the so-called folder there is an index.php file.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-07-31
@Fithanso

RewriteRule ^(.*)$ index.php/$1 [L]this construction is used when php script works with $_SERVER['PATH_INFO'] variable.
And when working with $_SERVER['REQUEST_URI'] is usually enoughRewriteRule ^ index.php [L]

RewriteEngine on

RewriteRule ^admin/ folder/ [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question