T
T
Tarrissarh2017-11-23 20:42:36
htaccess
Tarrissarh, 2017-11-23 20:42:36

How to make a redirect with a slash and redirect requests to index.php?

There is such htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php
</IfModule>

how do i add a "/" backslash at the end of the url here?
Rule found
RewriteCond %{REQUEST_URI} !\?
RewriteCond %{REQUEST_URI} !\&
RewriteCond %{REQUEST_URI} !\=
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} !\/$
RewriteRule ^(.*[^\/])$ /$1/ [R=301,L]

but I'll never know how to put it in my htaccess ...
Plus, how to completely remove index.php from the request?
There is a solution here, but when I inserted it into my htaccess, the redirect goes to the main one all the time, even if I remove
RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-11-24
@Tarrissarh

I described everything here, copy paste
And do not forget that it is not always necessary to take it to / sometimes you even have to remove it.
https://klondike-studio.ru/standards/standartnyy-h...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question