[Solved] How to force domain to have /home.html

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
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

[Solved] How to force domain to have /home.html

Post by applejack »

When the site first loads I need to go to domain.com/home.html also for the link created by the menu manager.

Any ideas besides setting up the initial page as a redirect ?
Last edited by applejack on Fri Apr 19, 2013 3:50 pm, edited 1 time in total.
chandra

Re: How to force domain to have /home.html

Post by chandra »

Create an empty page as "CMSMS startpage" and add this to your .htaccess

Code: Select all

RedirectPermanent / http://www.domain.com/home.html
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: How to force domain to have /home.html

Post by applejack »

Doesn't work goes into an infinite loop.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: How to force domain to have /home.html

Post by Rolf »

Set the default landing page as an internal link to "home" and not in menu
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: How to force domain to have /home.html

Post by applejack »

Rolf wrote:Set the default landing page as an internal link to "home" and not in menu
Tried it doesn't work. If you set a page to a redirecting link in the pages screen you cannot set it as the default. I tried making it a content page then set as default then changed to redirecting page but still no go.
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: How to force domain to have /home.html

Post by staartmees »

zet in je .htaccess

Code: Select all


DirectoryIndex home.html

applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: How to force domain to have /home.html

Post by applejack »

staartmees wrote:zet in je .htaccess

Code: Select all

DirectoryIndex home.html
Nope... goes to an Apache test page.
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: How to force domain to have /home.html

Post by staartmees »

you do have a page home.html with some text on your site?
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: How to force domain to have /home.html

Post by applejack »

staartmees wrote:you do have a page home.html with some text on your site?
Yes. Doesn't DirectoryIndex mean the initial directory for the virtual server rather that a file ? Which presumably is why it went to a Apache page as there is no such folder.
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: How to force domain to have /home.html

Post by applejack »

All that does is tell Apache to first look for those types of files with those names it doesn't force it to show home.html in the address bar.
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: How to force domain to have /home.html

Post by applejack »

Found it

RewriteCond %{DOCUMENT_ROOT}/index.html !-f
RewriteRule ^$ %{REQUEST_URI}home.html [R=301,L]

P.S. If you need to have home.html in the address bar if clicking on a home link then you also need to set up another page i.e. start, set that as the default and untick show in menu as otherwise clicking home the url shows as /

P.P.S. The reason for doing this is that I am doing a site using jQuery UI Mobile which loads content via ajax and so to it home.html and / are not the same.
Post Reply

Return to “CMSMS Core”