Page 1 of 1

[solved] Adding .html to page alias

Posted: Tue Aug 18, 2009 5:06 pm
by artturi
I have several static html pages which I'm importing to CMS MS. Most of those pages are not index pages of directories, but just normal pages with .html file extension. I want to avoid breaking any links and keep my search engine ranks, so I'd like to know how to create pages which have .html ending in the URL. I'm using pretty URLs.

.htaccess tricks are also welcome. All the static pages are in separate directory, so if there is a way to redirect all queries to http://domain.example/foo/*.html to http://domain.example/foo/*/ that would be fine too.

Re: Adding .html to page alias

Posted: Tue Aug 18, 2009 5:13 pm
by replytomk3
Search and documentation are your friends.

The setting to append .html is in config.php

The subject of keeping SEO ratings has been discussed on the forum. search for it.

.htaccess is described well in the documentation section of this website.

Re: Adding .html to page alias

Posted: Tue Aug 18, 2009 5:46 pm
by artturi
http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s describes how to add file extension to all pages, but I'd like to add that to only specific pages. So far that is the closes thing I've managed to find.

Re: Adding .html to page alias

Posted: Tue Aug 18, 2009 6:01 pm
by replytomk3
Good! What you are looking for is a 301 .htaccess redirect. Here is an example from mine site:

Code: Select all

redirect 301 /Firefox_downloading_MKRD_IP.html http://mkrd.info/?page=2-files-limit-fix
redirect 301 /firefox_downloading.html http://mkrd.info/?page=2-files-limit-fix
redirect 301 /funny/funny_stuff.html http://mkrd.info/?page=funny-stuff
redirect 301 /software/firefox/firefox_download_manager_2_files_limit_fix.html http://mkrd.info/?page=2-files-limit-fix
redirect 301 /software-discussions/cms-made-simple/quotes-in-cmsms-links.html http://mkrd.info/?page=cmsms-and-modules-bugs-and-problems
You see how someone requesting the .html file will actually be served a page generated from "?page="

Re: [solved] Adding .html to page alias

Posted: Wed Aug 19, 2009 3:49 pm
by artturi
Thanks, this works perfectly.

Re: [solved] Adding .html to page alias

Posted: Wed Aug 19, 2009 3:59 pm
by replytomk3
kudos for using [solved]