I'm facing the following problem with a combination of more than .htaccess
in my project.
I have the following structure
siteprincipal.com.br (não é WordPress)
and inside a subdomain with another WordPress site
site2.siteprincipal.com.br
site2 is inside a directory in public_html
, where the main site runs
I have two .htaccess
in the following structure
public_html (siteprincipal)
|--.htaccess
|--site2 (wordpress)
|--.htaccess
When I make a redirect
of a url from siteprincipal
to site2
, like for example
Redirect 301 /paginainterna/ http://site2.siteprincipal.com.br/paginainterna
the end result is
http://site2.siteprincipal.com.br/paginainterna////////////////
which results in an incorrect redirect.
content .htaccess
of siteprincipal
is
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
Redirect 301 /paginainterna/ http://site2.siteprincipal.com.br/paginainterna
#redirect sempre para www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule .* index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
and .htaccess
of site2
is the default for WordPress
# BEGIN WordPress
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
How can I prevent this "/" from being included, or what I am doing wrong?