Take the 2-minute tour ×

I want to use .htaccessto redirect different requests to the same folder. E.g.:




So whenever something is requested out of /ordner1/, /folder1/ or /casella1/ I want .htaccess to fetch the requested file out of a specific directory like domain.de/all/fileX.html.

I want to prevent duplicate content but also keep the foldernames in the selected language. Could you help me solve this problem?

share|improve this question
add comment

2 Answers

Try adding the following to the .htaccess file in the root directory of your site.

RewriteEngine on
RewriteBase / 

#skip css, js etc
RewriteCond %{REQUEST_URI} !\.(css|js)[NC] 
#if request to ordner or folder1 or casella1, serve the file from all/
RewriteRule ^(ordner1|en/folder1|it/casella1)/(.+)$ all/$2 [L,NC] 
share|improve this answer
Great, it works! BUT the css and the script files are not loading correctly (maybe wrong paths?) ... –  BlueHorizon Mar 18 '12 at 16:23
@BlueHorizon see edit above to skip js/css etc –  Ulrich Palha Mar 19 '12 at 1:19
Or call your js/css with absolute path : use : http://domain.com/css/style.css instead of /css/style.css –  iceduck Mar 19 '12 at 1:25
add comment

In your docroot/.htaccess:

RewriteEngine On
RewriteBase   /
RewriteRule   ^(ordner1/|en/folder1/|it/casella1/)(.*$)  all/$2  [L]

You would need to add extra names to map other translation equivalents.

share|improve this answer
add comment

Your Answer


