We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34026
    • 10 Posts
    I have a website build with Evo installed in the root folder, now I have placed all the files in a sub folder because of a new hosting environment.

    I have now in the root folder a .htacces with the following inside:

    RewriteCond %{HTTP_HOST} ^www.website.nl$
    RewriteCond %{REQUEST_URI} !^/subfolder/
    RewriteRule (.*) /subfolder/$1 [last]

    RewriteCond %{HTTP_HOST} ^website.nl$
    RewriteCond %{REQUEST_URI} !^/subfolder/
    RewriteRule (.*) /subfolder/$1 [last]

    and in the subfolder (with the modx installation) I have a .htaccess with the following inside:

    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.website\.nl [NC]
    RewriteRule (.*) http://www.website.nl/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    If I go to www.website.nl I get in the url the subfolder
    www.website.nl/subfolder
    www.website.nl/subfolder/somepage

    but I would like it to have it without the subfolder in the url like
    www.website.nl/
    www.website.nl/somepage

    what must I change to get this working without the subfolder in the urls?

    Thanks!
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      Your solution is within this thread, about 2/3 down the page.

      https://forums.modx.com/thread/?thread=73954#dis-post-410673
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 34026
        • 10 Posts
        Thank you very much!
          • 34026
          • 10 Posts
          Quote from: frogabog at Mar 28, 2012, 02:33 PM
          Your solution is within this thread, about 2/3 down the page.

          https://forums.modx.com/thread/?thread=73954#dis-post-410673

          I tried with the folowing rules in the root folder htaccess:

          RewriteEngine On

          RewriteRule ^manager$ /subfolder/manager/ [R=301,L]
          RewriteCond %{HTTP_HOST} ^website\.nl$ [OR]
          RewriteCond %{HTTP_HOST} ^www\.website\.nl$
          RewriteCond %{REQUEST_URI} !^/subfolder/
          RewriteRule (.*) /subfolder/$1

          In the subfolder (with modx installed) I have the folowing rules in htaccess:

          RewriteEngine On
          RewriteBase "/"

          RewriteCond %{HTTP_HOST} .
          RewriteCond %{HTTP_HOST} !^www\.website\.nl [NC]
          RewriteRule (.*) http://www.website.nl/$1 [R=301,L]

          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

          but the subfolder is still showing in the url how can I make it so that:

          www.website.nl/subfolder
          www.website.nl/subfolder/somepage

          will become:

          www.website.nl
          www.website.nl/somepage
            • 10208 ☆ A M B ☆
            • 1,780 Posts
            Mine are too. I finally made these changes to one site that needed it yesterday and it works for the home page, but not any other pages.

            Dangit...
              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster