I'm gonna take a code from this answer: Redirect folder to another with htaccess
So, I'd like to know where RewriteBase goes for real?! According to the smart guy from the linked answer it goes to the first part of the RewriteRule. So the second part requires a slash ("/")
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^test/(.*)$ /new/$1 [L,NC,R=302]
I don't remember where, but I read somewhere that it goes to the second part. And in fact my .htaccess is written in accordance with this rule. So, my rewrite rules looks this way
RewriteRule ^script$ folder/some_script [L,NC,R=302]
And actually it works for me. But now I read the linked answer because I need something other and I'm confused. I have no idea if this affects performance much, I just want to do it right. And I want to know "where it goes for real", to the first part, to the second, or to the both? Now I need a redirect from the folder+script to another folder+script. So how it should be?
#v1
RewriteBase /
RewriteRule ^/folder/some_script$ other_folder/some_other_script [L,NC,R=302]
⠀
#v2
RewriteBase /
RewriteRule ^folder/some_script$ /other_folder/some_other_script [L,NC,R=302]
⠀
#v3
RewriteBase /
RewriteRule ^/folder/some_script$ /other_folder/some_other_script [L,NC,R=302]⠀
⠀
#v4
RewriteBase /
RewriteRule ^folder/some_script$ other_folder/some_other_script [L,NC,R=302]⠀
I'd like to clarify that "yes", I need a redirect to another folder and which has a script with different name, so I don't need this "$1". One more thing please, don't guess, don't answer if you don't know that for sure. I can guess a lot of things too, I can test if this is work. I know that when I put the slash to the second part, it works, and if you don't put it also works. I mean:
RewriteBase /
# this works for me correctly
RewriteRule ^some_script$ folder/some_script [L,NC,R=302]
# this also works for me correctly, but I use the first way
# RewriteRule ^script$ /folder/some_script [L,NC,R=302]
I want to know how it's right! And I want to know how to do it right with a redirect from a folder.