Guest Posted June 26, 2009 Share Posted June 26, 2009 Hi, I have my current site in the structure below: / /index.php /images /css etc I have now uploaded a new site to /new So I have the structure / /index.php /images /css /new/index.php /new/images /new/css Is there a way I can use .htaccess to make it so when someone goes to the site, it treats the /new folder as the root. I only managed "RedirectMatch ^/$ /new", but that redirects so the user sees the /new... Thanks, Josh Link to comment https://forums.phpfreaks.com/topic/163767-htaccess-treat-new-as-root-folder/ Share on other sites More sharing options...
BMurtagh Posted July 2, 2009 Share Posted July 2, 2009 Hi Josh, The rewrite rule you'll want to use in the .htaccess is: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} domain.com RewriteCond %{REQUEST_URI} !<subfolder>/ RewriteRule ^(.*)$ <subfolder>/$1 [L] Save the changes & you should be good to go Link to comment https://forums.phpfreaks.com/topic/163767-htaccess-treat-new-as-root-folder/#findComment-867639 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.