1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

Redirect pages of root folder to index and pages of subfolder to index of subfolder

Discussion in 'Black Hat SEO Tools' started by kurosaki4d, Sep 24, 2019.

  1. kurosaki4d

    kurosaki4d Regular Member

    Joined:
    Apr 24, 2018
    Messages:
    321
    Likes Received:
    16
    Gender:
    Male
    Occupation:
    Growth hacking, Marketing, Reskin, Dropshipping
    As the title says, i have the root directory that contains pages and i have another directory that it's called mobile.

    I would like the pages that are inside the root directory to be all redirected to index.php in root, as for the mobile directory i want all the pages inside it to be redirected to the other index.php that is inside /mobile

    I have tried multiple times but it seems that sometimes i can only get one folder working at a time.

    Any help would be much appreciated !

    Thank you
     
  2. kurosaki4d

    kurosaki4d Regular Member

    Joined:
    Apr 24, 2018
    Messages:
    321
    Likes Received:
    16
    Gender:
    Male
    Occupation:
    Growth hacking, Marketing, Reskin, Dropshipping
    For people who might face a similar issue, this is what worked for me:

    I've created two htaccess files one inside the root directory and another one inside the subdirectory, and i placed the following codes inside both htaccess files:



    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteRule ^ index.php [L]