Two Rewrite rules needed for different site sections?

Discussion in 'Apache' started by Seelife, Jun 23, 2013.

  1. #1
    Hi Folks, I am still trying to understand rewriting and I am sorry for the basic question.
    We have just upgraded a Joomla site from 1.5 to 2.5. The site has typical articles and also a Link Directory. To rebuild, we built the new site in a new separate folder.
    We imported all articles, images etc into the new build so article names stay the same(mostly), the link directory entries were imported into a new link manager that has a different url structure.

    So our basic URLs are like this :
    old format: MJ/hospitality/hospitality-news/hotel-industry/1679-an-article-title
    new format: MA/hospitality/hospitality-news/hotel-industry/1679-an-article-title

    (My proposed rule for that is : RewriteRule ^MJ/(.*) http://www.example.com/MA/$1 [R=301,L])
    However:
    My link directory urls go from :
    Old : http://www.example.com/MJ/wsn/hotel-/a-great-hotel-759.html
    New : http://www.example.com/MA/micedirectory/10277-a-great-hotel
    (there is no file type)


    From what I understand, my suggested rule will not work for the link directory urls.
    While the actual listing text part DOES NOT change, the bit I dont understand is - can I get a rule that deals with the different ID-number and in a different part of the URL (I cant change the ID location from what I understand - its part of the SobiPro database system).

    So - is it possible to have two rewrite rules that trap these two situations.
    My main aim is to still direct already well indexed traffic without a "page not found" error as much as possible.
    Thanks so much.
     
    Seelife, Jun 23, 2013 IP