0
votes

I rebuilded site with new design old webpage had urls ending with .html. Webpage has 3 languages. Domain stays the same.

I plan to do few things:

  1. Remove .html at end of all urls.
  2. Redirect old news articles to main news (2 languages) directory.
  3. Remove language code /lv from main language.
  4. Rewrite main language news article urls without /lv and html.

Main products / contacts / info I will redirect manually using joomla built in redirect system (they are few) but news articles are old (about 500 in every language) and I want to redirect /en and /ru to language based news category.

Main language news I exported to new webpage but now they don't have language code /lv and .html at the end.

Old urls looks like: http://vervo.lv/ru/news/43-jaunumi/538-2012gad-transporta-joma-butiski-attistjusas-attiecibas-ar-afganistanu.html

I plan redirect them to mysite.lv/ru/novosti, mysite.lv/en/news

Is it possible to redirect every thing from directory mysite.lv/ru/news.html to mysite.lv/ru/news and the same for 3 languages? not redirecting other stuff ?

Could you suggest how to correctly do this. I am not programmer. just advanced joomla user.

2

2 Answers

0
votes

Yes this is possible with .htaccess and mod_rewrite. If it doesn't work try commenting or removing the line Options +FollowSymLinks.

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # Remove .html
    RewriteRule ^(.*)\.html$ /$1 [NC]

    # Strip main language code
    RewriteRule ^lv/(.*) /$1 [NC,R=301,L]

    # Redirect old to new RU news
    RewriteRule ^ru/news/43-jaunumi/(.*) /ru/novosti/$1 [NC,R=301,L]

    # Redirect old to new EN news
    RewriteRule ^en/news/43-jaunumi/(.*) /en/news/$1 [NC.R=301,L]
</IfModule>
0
votes

an easier non-programmer approach could be to use a SEF component (or joomla redirect) but it will take longer than implementing mrfeelgood's solution. Try sh404 for an easy to use solution.