• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [solved]change static site to cmsms/file extensions/htaccess
PostPosted: Thu Apr 12, 2012 5:17 pm 
Offline
Forum Members
Forum Members

Joined: Fri Feb 17, 2012 4:25 pm
Posts: 89
At the moment I have a static html site which has mostly file extensions .html and two .php pages.
The plan is to change it to a cmsms site which I am working on on a local server.

At present if I type "http://www.mysite.com/page it shows the page the same as if I type in "http://www.mysite.com/page.html.

What I was wondering about is that currently search engines read all my links with the page extensions as all my internal links have the page extensions included. When I change over to cmsms I will need the old links "http://www.mysite.com/page.html to be directed to page "http://www.mysite.com/page or I will get broken links. How do I modify my .htacess file to do this or is there an easier way?


Last edited by ladyr0gue on Fri Apr 13, 2012 8:07 pm, edited 4 times in total.

Top
 Profile  
 
 Post subject: Re: changing static site to cmsms, file extensions, htaccess
PostPosted: Thu Apr 12, 2012 5:31 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 6583
Location: Fernie British Columbia, Canada
CMSMS supports multiple routes to the same content page.

i.e: "http://mysite.com/index.php?page=alias (this will always work)
"http://mysite.com/index.php/alias (using internal pretty urls without a page extension)
"http://mysite.com/index.php/alias.html (using internal urls with a page extension)
"http://mysite.com/index.php/a/url/i/created.html (using internal urls with a page extension)
"http://mysite.com/index.php/a/url/i/created (using internal urls without a page extension)
"http://mysite.com/alias (using mod_rewrite without a page extension)
"http://mysite.com/alias.html (using mod_rewrite with a page extension)
"http://mysite.com/a/url/i/created (using mod_rewrite with a custom url for a content page)
"http://mysite.com/a/url/i/created.html (using mod_rewrite with a custom url for a content page and a page extension created).

The secret for a migrated site is:
a: configure a reasonable page extension in your config.php. In your case '.html' would probably be best. If your page extension on your static site was .html before, and you named your aliases properly this should handle 90% of the cases.
b: ensure that the rel=canonical stuff is in place properly so that the search engines know the true url to the page to ensure that search engines don't penalize you for duplicate content.
c: Use the cms_selflink, menumanager and other link mechanisms (don't create links yourself) so that all links within your website are created consistently.
d: Use .htaccess 301 or 302 rules to redirect all old links that you couldn't cover with the steps above to the new pages. This, in conjunction with the rel=canonical will allow anybody (or any search engine) following on an old link to your site to be directed to the correct page, and then see the rel=canonical link to know that the followed URL is the 'one true' url.

_________________
Follow me on twitter
--
if you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
----------------
Don't make me angry..... you won't like me when I'm angry....


Top
 Profile  
 
 Post subject: Re: changing static site to cmsms, file extensions, htaccess
PostPosted: Thu Apr 12, 2012 7:07 pm 
Offline
Forum Members
Forum Members

Joined: Fri Feb 17, 2012 4:25 pm
Posts: 89
Thank you for your quick reply,
Just to make sure I've understood you correctly,
on my cmsms site's config.php in the url setting I have put
Code:
$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';

Do I need to add .html to the aliases? as at the moment it doesn't seem to make any difference...

in my .htaccess I currently have
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA,NE]
to rewrite the urls in the form of /parent/child/ - do I still need to implement rel=canonical and if so how do I do that? Sorry I've been away from the project for a while and seem to have forgotten everything :/

edit: realised i had an instance of
Code:
$config['page_extension'] = '/';
as well in the config.php, removed that and now the pages are rewritten as .html as required, thanks :) - so for the two remaining .php pages I'll just 301 redirect them to the new 'pretend' .html versions.

Still unclear on how or where to implement rel=canonical though.


Top
 Profile  
 
 Post subject: Re: changing static site to cmsms, file extensions, htaccess
PostPosted: Thu Apr 12, 2012 7:34 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 11812
Location: Arizona
In the <head> of default CMSMS template you should find...

{if isset($canonical)}
<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}
<link rel="canonical" href="{$content_obj->GetURL()}" />
{/if}

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get its parameters.
Right click and view source is a great way to see what you have to work with.
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image


Top
 Profile  
 
 Post subject: Re: changing static site to cmsms, file extensions, htaccess
PostPosted: Thu Apr 12, 2012 7:40 pm 
Offline
Forum Members
Forum Members

Joined: Fri Feb 17, 2012 4:25 pm
Posts: 89
ah lovely. thanks. As I'm making my own template from scratch I'd missed that bit :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting