I have been searching for this for many hours and I have no idea how to accomplish that. I need to make the following 301 permanent redirect:
When people visit
http://web.domain.com.br/something/
They should be redirected to
http://domain.com.br/something/
Where (important!), the /something/ is not a real directory,
it is a sub-blog from the wordpress multisite installation.
There are another rules on the root .htaccess file already in action. They are:
RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L] RewriteRule ^[_0-9a-zA-Z-]+/(.*.php)$ $1 [L] RewriteRule . index.php [L]
My domain actually already has a some kind of redirect, out of my sight, created by someone on the control panel. They did create the following:
When you visit:
http://web.domain.com.br/
You go to:
http://domain.com.br/
For the home part, this is ok.
But whenever I try something like:
http://web.domain.com.br/opaopa/
I got redirected to:
http://domain.com.br/
AND, if I phisically create inside my root the directory /opaopa/
the redirect trhows me there… However, I can’t create real directories for my wordpress subsites, because the apache gives preference to them, instead of loading the “magic” of the wordpress multisite network.
Sorry if it sounds confusing…
English is not my natural language.
Thanks sooo much for your attention.
Regards,
G.
add this just after
RewriteBase ...
(so before all the other rewrite-rules)