Good day to all. Recently ran into a problem. There is site site.ru and I want to put a second site in its site.ru/game directory. The problem is that the links of the second site look like site.ru/news/ and you need to be site.ru/game/news/ , how to do it with htaccess?

    1 answer 1

    If you want to save links:

     RewriteEngine On RewriteRule ^news(.*)$ /game/news$1 

    If forwarding is needed:

     RewriteEngine On RewriteRule ^news(.*)$ /game/news$1 [L,R=301] 
    • Thank you very much. And how to attach all links at the beginning of the game, if you have something to catch? - Alex
    • @Alex and how do you determine if this is a link to the first site or the second one? - Crantisz
    • No, I'm trying to connect 2 sites. - Alex
    • @Alex so if you cannot determine for yourself, how will the server do it? - Crantisz
    • And according to the catalog in which there are 2 site, you can not change the links? - Alex