Why not work RewriteRule?

There is such a line http://projects/calendar/index.php?section=1
Trying to do NC.
Write the following in httaccess:
AddDefaultCharset UTF-8
RewriteEngine on
RewriteRule ^/section-([0-9]+)\.html$ /index.php?section=$1

But nothing happens, the Url doesn't change. What could be the problem?
April 7th 20 at 15:24
1 answer
April 7th 20 at 15:26
The answer is:
"How to do a redirect with a GET parameter"
Het is not part of the url.
https://donatstudios.com/RewriteRule_Generator
do not forget that if you want to select a group from the RewriteCond it will not be $1 and %1
Thanks for the link, I think in the future will be useful.

But I was not able to solve the problem.

Made to test the following:
projects/test/about.html => projects/test/about

I tried rewrite and 301:
# Rewrite --- projects/test/about.html => projects/test/about
RewriteRule ^test/about\.html$ /test/about?&%{QUERY_STRING}

# 301 --- projects/test/about.html => projects/test/about
RewriteRule ^test/about\.html$ /test/about? [L,R=301]

At the end as it was .html, and left. In what may be another reason? Use OpenServer, maybe it's the problem? - keyon.Klein commented on April 7th 20 at 15:29
Options +FollowSymLinks
RewriteEngine On
# include redirects

RewriteCond %{REQUEST_URI} ^(.*)/index\.html$
 # URL contains index.php in the end.
RewriteCond %{REQUEST_METHOD} =GET
 # Identify the GET request in the URL (not POST).
RewriteRule ^(.*)$ %1/ [R=301,L]
 # Remove index.htmlиз URL.



RewriteCond %{REQUEST_FILENAME} !-f
# if the url not the file
RewriteCond %{REQUEST_FILENAME} !-l
# if the url is not a link (shortcut shorter)
RewriteCond %{REQUEST_FILENAME} !-d
# if not a directory
RewriteCond %{QUERY_STRING} (^|&)section\=(.+)($|&)
# If there is a get request setctiin= and it is not empty, then select all after the same ( only this request)
RewriteCond %{REQUEST_FILENAME} !/index\.php$
# If there is no index php ( to avoid cycles)
RewriteRule ^(.*)$ /index.php\?section=%2? [L]
# Then redirect to index PHP, add a get parameter seksyen, insert the second bracket of the rules with a get parameter.


If you need to remove the old one gets put at the end of the rules question after %2 - jordy20 commented on April 7th 20 at 15:32
Thanks for the detailed answer, but it did not help, the url is not changing :( - keyon.Klein commented on April 7th 20 at 15:35
give me the url of the pages - jordy20 commented on April 7th 20 at 15:38
All of the url given above.
This is the one I want us to do:
projects/calendar/index.php?section=1

This was done to try .html clean
projects/test/about.html - keyon.Klein commented on April 7th 20 at 15:41
can't see the name of the domain where I see the http response ? - jordy20 commented on April 7th 20 at 15:44
http: + //projects/test/about.html so, here on the website just the beginning removed - keyon.Klein commented on April 7th 20 at 15:47
@dora.Co, well, how am I supposed to watch the response of your website ?
You set up direct and pay the money to you on the site went
when you want to go you also help site you think that these data are confidential and begin to remove them EN masse. - jordy20 commented on April 7th 20 at 15:50
You probably do not understand, I have this site is no where posted, I have it on my local server on the computer and the way that I it took off, same as in my browser. OpenServer just rename localhost to the name of the folder in which the project lies. I therefore ask, is it possible that not working because of this? - keyon.Klein commented on April 7th 20 at 15:53
hmm ;) approx.
come on all .htaccess - jordy20 commented on April 7th 20 at 15:56
Why? In this file I put all the things that you threw above, there's nothing. - keyon.Klein commented on April 7th 20 at 15:59

Find more questions by tags htaccessProcessing URL