Posts: 13
Threads: 3
Joined: Nov 2011
2011-11-12, 08:05:30
(This post was last modified: 2011-11-12, 08:08:25 by Minda.)
My current site (in another CMS) is located in the root. I want to move it entirely to subdir (for example "newroot"). But I want that all links from my old site, remain untouched: old link is
www.mysite.com/index.html the new one after moving will be
www.mysite.com/newroot/index.html. But I need that new link in new site for external world was remain in old form -
www.mysite.com/index.html
As I know this can be done via mod rewrite, but I don`t know what exactly must be written and in what order.
Please help me to move my site to the new (internal) location and preserve (external) links to it.
Posts: 2,928
Threads: 195
Joined: Feb 2011
Posts: 88
Threads: 9
Joined: Feb 2011
zencoder Wrote:old link is www.mysite.com/index.html the new one after moving will be www.mysite.com/newroot/index.html. But I need that new link in new site for external world was remain in old form - www.mysite.com/index.html
Try using in your mysite.com folder following .htaccess content:
Code:
AddDefaultCharset UTF-8
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9-]+)\.html$ newwroot/index.php?id=$1 [QSA,L]
also to make use of built-in GS menu (to be able to add pages to menu an then use
get_navigation() in template) in custom permalinks settings set:
Please keep in mind I am not an expert and can't test the above or guarantee it works.
Posts: 1,204
Threads: 30
Joined: Jun 2010
Simplest way to do it:
1. edit main .htaccess file, and change RewriteBase / to RewriteBase /newroot
2. move all GS file to newroot dir, leaving only .htaccess file in root directory
Addons: blue business theme, Online Visitors, Notepad