Skip to content

Instantly share code, notes, and snippets.

@YuzuruSano
Created September 17, 2015 14:34
Show Gist options
  • Save YuzuruSano/a24adb7ccfb903ce5960 to your computer and use it in GitHub Desktop.
Save YuzuruSano/a24adb7ccfb903ce5960 to your computer and use it in GitHub Desktop.
【concrete5】下層ディレクトリからファイルを動かさずにルートで公開する(参考:http://concrete5-japan.org/community/forums/5-7-x/post-10739/
DirectoryIndex index.html index.php
RewriteEngine On
RewriteBase /
RewriteRule ^$ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^concrete5dir/ [NC]
RewriteRule ^(.*)$ /concrete5dir/$1
# @concrete5dir/
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /concrete5dir/index.php/$1 [L]
</IfModule>
# -- concrete5 urls end --
<?php
//@concrete5dir/
$_SERVER['REDIRECT_URL'] = str_replace('concrete5dir/', '', $_SERVER['REDIRECT_URL']);
$_SERVER['ORIG_PATH_INFO'] = str_replace('concrete5dir/', '', $_SERVER['ORIG_PATH_INFO']);
$_SERVER['PATH_INFO'] = str_replace('concrete5dir/', '', $_SERVER['PATH_INFO']);
$_SERVER['SCRIPT_NAME'] = str_replace('concrete5dir/', '', $_SERVER['SCRIPT_NAME']);
require('concrete/dispatcher.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment