Mod_rewrite: Two websites, relative links to images. Rewrite image URL request to a single physical folder?

If you want an external redirect (actually send the browser to the new URL): Redirect permanent /en/images/ /images Otherwise Alias /en/images /var/www/document_root/images This should go in the VirtualHost block for the website If and only if you do not have access to the virtual host configuration, and if you want an internal redirect, you can put this in var/www/document_root/en/images/. Htaccess : RewriteEngine on RewriteRule . * /var/www/document_root/images/$0.

If you want an external redirect (actually send the browser to the new URL): Redirect permanent /en/images/ /images/ Otherwise, Alias /en/images /var/www/document_root/images/ This should go in the block for the website. If and only if you do not have access to the virtual host configuration, and if you want an internal redirect, you can put this in /var/www/document_root/en/images/. Htaccess: RewriteEngine on RewriteRule .

* /var/www/document_root/images/$0.

I have access to , but I would prefer to use . Htaccess, because, in case I have to move it to another domain, I would not depend on the server config. .

Htaccess will move together with it. Is it a fair assumption? Why is preferrable?

– wyxa 14 hours ago It saves processing power and file accesses, plus it can reduce your security risk in some cases. See the Apache documentation. And if you change servers/domains, you're going to have to transfer other changes in the main server configuration anyway, so you have little to lose by putting redirects there as well.

– David Zaslavsky 14 hours ago Putting RewriteRule . * /var/www/document_root/images/$1 in . Htaccess file in /var/www/document_root/en/images/.

Htaccess didn't do the job either. Now I'm getting blank page instead of 404 error, when I try to access http://domain/en/images/1. Jpg – wyxa 14 hours ago Ah, I made a typo.

(This is another benefit of putting things in the main server configuration: the directives are frequently simpler) – David Zaslavsky 13 hours ago Hm... it didn't work either... - blank page. However, it works, if I put it this way: RewriteRule (.*) /images/$1 R,L it is redirecting browser properly. I tried the directives - no effect - I will discuss it with my hoster.

– wyxa 11 hours ago.

If you put that in your document root, it should work, but if you want to redirect the browser, you need a R at the end of your RewriteRule, and to be safe, an L, too. RewriteRule ^en/images/(.*)$ /images/$1 R,L To redirect with a 301 (permanent), change R to R=301.

It didn't work for RewriteRule ^en/images/(.*)$ /images/$1 R,L for reasons I don't know - still giving 404 error (e.g. For /en/images/1. Jpg). Actually, it's Joomla website, and there are some rules in .

Htaccess for SEF urls. I have inserted the rule above the SEF rules. – wyxa 14 hours ago.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions