1
1
1katerina92019-08-20 15:25:54
PHP
1katerina9, 2019-08-20 15:25:54

How can I remove the slash in front of the parameter?

Now I have a link of this type site.ru/?page=4 how to remove the slash so that the link works like this site.ru?page=4 , if I try to remove the slash in the URL, then the page automatically reloads and the slash returns.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bkosun, 2019-08-20
@1katerina9

In the .htaccess file, add the following rules:
1. In the mod_dir section (after RewriteBase):
2. In the mod_rewrite section (before DirecroryIndex):

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question