4571 Posts in 1382 Topics by 1376 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1093 Views |
-
Index file for now

20 March 2009 at 10:28am
Is there a way to have an index.htm page show up as a "Coming soon" page which everyone views when they goto the URL.... but if i type in a page name i know works... ie about-us/ after the url it will work...
i tried allowing just my IP being able to view the site and everyone else got a maintenance file... however my client is looking at the site in progress as well and they are coming from many IP addresses on numorous machines and maintainting that would be hard work
Is it possible to have the URL goto index.html but allow us to type in a known address to goto that relevant page
-
Re: Index file for now

20 March 2009 at 10:13pm
You could start by adding another line to your .htaccess file, right behind where it says: RewriteBase /. this could be someting like
RewriteRule ^$ index.html [L]
(I'm no htaccess expert, but this works for me). If you find you now can no longer reach your homepage from your site's menu, because it now too points to index.html, you need to (temporarily) change your homepage's URL in the backend, where it probably says something like
'http://www.yoursite.xx/home'
to
'http://www.yoursite.xx/something_different'
-
Re: Index file for now

21 March 2009 at 10:09pm Last edited: 21 March 2009 10:11pm
Thought a bit further. This works in 2.3.0 on Linux: you could set the base directory for your site to some imaginary 'testingthis' directory, by putting this in the _config.php file of your site (provided your site resides in the root):
Director::setBaseURL('/testingthis/');
Then you could adapt your rewriteRules something like this (quick fix, no expert, see above
):
RewriteCond %{REQUEST_URI} (\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$
RewriteRule ^testingthis/(.*)$ $1 [L]RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$
RewriteCond %{REQUEST_URI} ^(/testingthis)(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%2&%{QUERY_STRING} [L]You don't have to change the homepage url for this one. You can now call your site in /testingthis/, requesting the root of the site wil redirect to index.html, links to /testingthis/ will be created automatically, and all other pages will give a not found error. This has probably been done better - if so, please point me to it.
| 1093 Views | ||
|
Page:
1
|
Go to Top |

