Page 1 of 1
[Solved] How to force domain to have /home.html
Posted: Fri Apr 19, 2013 3:15 am
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 ?
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 4:45 am
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
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 12:21 pm
by applejack
Doesn't work goes into an infinite loop.
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 12:44 pm
by Rolf
Set the default landing page as an internal link to "home" and not in menu
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 12:59 pm
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.
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 3:04 pm
by staartmees
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 3:12 pm
by applejack
staartmees wrote:zet in je .htaccess
Nope... goes to an Apache test page.
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 3:15 pm
by staartmees
you do have a page home.html with some text on your site?
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 3:20 pm
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.
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 3:28 pm
by staartmees
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 3:36 pm
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.
Re: How to force domain to have /home.html
Posted: Fri Apr 19, 2013 3:49 pm
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.