I'm in all ways trying to create a redirect with htaccess and I got it like this:
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
Options +FollowSymLinks
RewriteCond %{REQUEST_URI} !^/(?:index\.php|robots\.txt)$
RewriteRule (.*) http://meusite.com/novapasta/$1 [R=301,L]
</ifModule>
The problem that at the time I type in the URL any file other than index.php or robots.txt it plays into that folder.
Ex: sitemap.xml it is targeting myite.com/novapasta/sitemap.xml and I do not want this.
I tried to put:
RewriteCond %{REQUEST_URI} !^/(?:index\.php|robots\.txt|sitemap\.xml)$
But it does not accept and direct from the root to /novapasta/sitemap.xml folder
Until folders it is directing.
Ex: meusite.com/imagens
to meusite.com/novapasta/imagens/
How can I stop this?
What I need:
So I always test in private mode and it still directs. I actually have a site that it had a querystring that makes the links stay
-
http://meusite.com/produto.php?produto=$1
-
http://meusite.com/produto
Now I want to play everything into this new folder
-
http://meusite.com/novapasta/produto
Only with this redirect if I try to access:
http://meusite.com/sitemap.xml
, http://meusite.com/imagens/
and http://meusite.com/diretorioqualquer
he plays for:
http://meusite.com/novapasta/sitemap.xml
, http://meusite.com/novapasta/imagens/
e
http://meusite.com/novapasta/diretorioqualquer
The only ones he does not play are the index and the robots and he would like to play only what comes from produto.php?produto=$1
So I always test in private mode and it still directs. I actually have a site that it had a querystring that makes the links stay
link $ 1
Now I want to play everything into this new folder
Only with this redirect if I try to access
He plays for
The only ones he does not play are the index and the robots and he would like to play only what comes from the product.php? product = $ 1