htaccess ... redirect 301 problems

Hi Lads!!

Well, I just would like some help trying to redirect some urls… well the story is I had to publish my website in spanish and I didnt setup to show language in the urls.

Now I have translate my site to french and english and my problems did start, now I have to setup showing the languages in the urls and goggle did already index all my urls so If I setup to show languages in the urls all the urls indexed by google will show 404

I have tried to do this:

RewriteCond %{query_string} /

RewriteRule (.*) [url]http://www.thedomain/es/?[/url] [R=301,L]

or even

redirect 301 / [url]http://www.thedomain/es/[/url] <— (bad redirect or something like this it said)

but no luck. Does someone know what I´m doing wrong?

Thanks in advance


RewriteRule ^/?$ “http://www\thedomain\” [R=301,L]

Here is an example of .htaccess rewrite rules to redirect your old URLs to new URLs:

```php RewriteEngine on

For categories ####

RewriteCond %{query_string} idCategory=1234

RewriteRule (.*) [R=301,L]

For products ###

RewriteCond %{query_string} idproduct=1234

RewriteRule (.*) [R=301,L] ```

Hi Roban and indy0077

well , trying, trying… Roban what you said to me looks like working but… when you type: it goes to (it was what I was looking for!!!) but when you click on “any link” in the website, the language reference (/fr/) dissapear, so it comes back to spanish language.

indy007 I have tried yours but I dont really know if I´m doing it right because nothing happens, I suppose another rule written in the htaccess is stoping your code… could it be?

Here you are my htaccess:

RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} ./catalog/.

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{REQUEST_FILENAME}/index.html !-f

RewriteRule . index.php?sef_rewrite=1 [L,QSA]

Ahh, I forgot…, lads thanks for writing!!!