[solved] Adding .html to page alias

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
artturi
New Member
New Member
Posts: 4
Joined: Fri Apr 17, 2009 4:32 pm

[solved] Adding .html to page alias

Post 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.
Last edited by artturi on Wed Aug 19, 2009 3:49 pm, edited 1 time in total.
replytomk3

Re: Adding .html to page alias

Post 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.
artturi
New Member
New Member
Posts: 4
Joined: Fri Apr 17, 2009 4:32 pm

Re: Adding .html to page alias

Post 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.
replytomk3

Re: Adding .html to page alias

Post 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="
artturi
New Member
New Member
Posts: 4
Joined: Fri Apr 17, 2009 4:32 pm

Re: [solved] Adding .html to page alias

Post by artturi »

Thanks, this works perfectly.
replytomk3

Re: [solved] Adding .html to page alias

Post by replytomk3 »

kudos for using [solved]
Post Reply

Return to “CMSMS Core”