1
My site is in a subfolder, I want the path to work independently of what I enter in the name of it, for example:
www.meudominio.com.br/something/index.php
www.meudominio.com.br/whatever-thing1/index.php
www.meudominio.com.br/whatever-thing2/index.php
www.meudominio.com.br/whatever-thing3/index.php
www.meudominio.com.br/whatever-thing4/index.php
www.meudominio.com.br/whatever-thing5/index.php
Where "anything" is going to change several times, it should work as an Alias for the subfolder where the site is, recognizing really anything that is written there.
If I manually insert in the script the name I want, I realized it works, this way:
RewriteRule ^nome-que-eu-quero\/?(.*)$ /pasta_site/$1 [L,QSA]
But I need him to accept everything I put in before the deli, so I tried to do:
RewriteRule ^(.*)\/?(.*)$ /pasta_site/$2 [L,QSA]
But it doesn’t work. What am I doing wrong? Is there a more practical way to make it work?
Thanks in advance.
You can put some examples of input and desired output?
– Paz
I made an edit on the question and added an example of the URL how it has to work.
– Leo
You must return www.meudominio.com.br/pasta_site/index.php, knowing that "pasta_site" is the real folder where the site is located.
– Leo
I have tried this way, I have not succeeded. There is some piece of code that should be cited before this?
– Leo
I’m quoting only Rewriteengine On, then the code.
– Leo
I can’t see where you’re going wrong, the regex I posted in the comments works, see https://regex101.com/r/y3Y7kr/2
– Paz