Inside the VirtualHost I got this redirect:
RewriteBase /
RewriteCond %{REQUEST_URI} wp-content/uploads/([^.]+\.(jpe?g|gif|bmp|png))$
RewriteRule (.*) http://example.org/$1 [R=301,L,NC]
So the full VirtualHost config is:
<VirtualHost *:80>
ServerName localhost.foo
ServerAdmin webmaster@localhost
DocumentRoot /home/me/public_html/foo
LogLevel info
ErrorLog /home/me/public_html/foo/error.log
CustomLog /home/me/public_html/foo/access.log combined
<Directory "/home/me/public_html/foo">
Options FollowSymLinks Indexes
AllowOverride All
RewriteBase /
RewriteCond %{REQUEST_URI} wp-content/uploads/([^.]+\.(jpe?g|gif|bmp|png))$
RewriteRule (.*) http://example.org/$1 [R=301,L,NC]
</Directory>
</VirtualHost>
But in a subfolder I got a .htaccess
changing the RewriteBase:
RewriteBase /thisIsMe
Now when I access an image
http://localhost.foo/thisIsMe/wp-content/uploads/someImage.jpg
- Should redirect to:
http://example.org/thisIsMe/wp-content/uploads/someImage.jpg
- but redirects to
http://example.org/wp-content/uploads/someImage.jpg
So the RewriteBase /thisIsMe
in the URL got lost.
How can I achieve the correct URL as above?