Force Mibew to work without mod_rewrite

This commit is contained in:
Dmitriy Simushev 2014-09-10 10:56:06 +00:00
parent 7c969e495e
commit 86085a0c31
2 changed files with 33 additions and 3 deletions

View File

@ -1,6 +1,3 @@
# Set default handler for incoming requests
DirectoryIndex index.php
# Disable directory listing # Disable directory listing
Options -Indexes Options -Indexes
@ -26,6 +23,9 @@ Options +FollowSymLinks
# Redirect requests to the front controller # Redirect requests to the front controller
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
# Use the front controller as a default handler
DirectoryIndex index.php
RewriteEngine On RewriteEngine On
# Use separate front controller for the system installator # Use separate front controller for the system installator
@ -40,6 +40,13 @@ Options +FollowSymLinks
RewriteRule ^(.*)$ index.php [QSA,L] RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule> </IfModule>
<IfModule !mod_rewrite.c>
# There is no mod_rewrite in the system. For the root Mibew directory
# index_fallback.php should be loaded first to activate old-fashioned URLs.
# For all other directories index.php is just a directory index file.
DirectoryIndex index_fallback.php index.php
</IfModule>
# Deny access to internal system files # Deny access to internal system files
<FilesMatch "\.(yml|po|ini|handlebars|keep)$"> <FilesMatch "\.(yml|po|ini|handlebars|keep)$">
Deny from all Deny from all

View File

@ -0,0 +1,23 @@
<?php
/*
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Force the user to specify the entry point. This should be done only when
// mod_rewrite is not used by apache.
header('HTTP/1.0 301 Moved Permanently');
header('Location: index.php/');