[php-blog-cvs] r2732 - in trunk: docs include include/tpl
A reliable, secure & extensible PHP blog | Not mainstream since 2002
Brought to you by:
garvinhicking,
jhermanns
From: <gar...@ma...> - 2011-01-15 13:33:07
|
Author: garvinhicking Date: 2011-01-15 14:32:59 +0100 (Sat, 15 Jan 2011) New Revision: 2732 Added: trunk/include/tpl/htaccess_cgi_rewrite2.tpl trunk/include/tpl/htaccess_rewrite2.tpl Modified: trunk/docs/NEWS trunk/include/functions_config.inc.php trunk/include/functions_installer.inc.php trunk/include/tpl/htaccess_cgi_rewrite.tpl trunk/include/tpl/htaccess_rewrite.tpl Log: new mod rewrite option Modified: trunk/docs/NEWS =================================================================== --- trunk/docs/NEWS 2011-01-11 21:17:07 UTC (rev 2731) +++ trunk/docs/NEWS 2011-01-15 13:32:59 UTC (rev 2732) @@ -3,6 +3,10 @@ Version 1.6 () ------------------------------------------------------------------------ + * Added new rewrite option for 1&1 specific servers, because a + combined htaccess for both variants could not be find. The reason + is the MultiViews option in certain apache configs. + * Fix PDO::SQLite to properly fetch the requested row type (assoc/both/num), important for staticpage plugin Modified: trunk/include/functions_config.inc.php =================================================================== --- trunk/include/functions_config.inc.php 2011-01-11 21:17:07 UTC (rev 2731) +++ trunk/include/functions_config.inc.php 2011-01-15 13:32:59 UTC (rev 2732) @@ -1,3 +1,4 @@ + <?php # $Id$ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details @@ -920,6 +921,10 @@ if( !function_exists('apache_get_modules') || in_array('mod_rewrite', apache_get_modules()) ) { $res['rewrite'] = 'Use Apache mod_rewrite'; } + if( !function_exists('apache_get_modules') || in_array('mod_rewrite', apache_get_modules()) ) { + $res['rewrite2'] = 'Use Apache mod_rewrite (for 1&1 and problematic servers)'; + } + break; } Modified: trunk/include/functions_installer.inc.php =================================================================== --- trunk/include/functions_installer.inc.php 2011-01-11 21:17:07 UTC (rev 2731) +++ trunk/include/functions_installer.inc.php 2011-01-15 13:32:59 UTC (rev 2732) @@ -855,8 +855,10 @@ } - if ($rewrite == 'rewrite') { - $template = 'htaccess' . $htaccess_cgi . '_rewrite.tpl'; + if ($rewrite == 'rewrite2') { + $template = 'htaccess' . $htaccess_cgi . '_rewrite2.tpl'; + } elseif ($rewrite == 'rewrite') { + $template = 'htaccess' . $htaccess_cgi . '_rewrite.tpl'; } elseif ($rewrite == 'errordocs') { $template = 'htaccess' . $htaccess_cgi . '_errordocs.tpl'; } else { Modified: trunk/include/tpl/htaccess_cgi_rewrite.tpl =================================================================== --- trunk/include/tpl/htaccess_cgi_rewrite.tpl 2011-01-11 21:17:07 UTC (rev 2731) +++ trunk/include/tpl/htaccess_cgi_rewrite.tpl 2011-01-15 13:32:59 UTC (rev 2732) @@ -22,7 +22,7 @@ RewriteRule ^{PAT_PLUGIN} {indexFile}?url=$1/$2 [L,QSA] RewriteRule ^{PAT_SEARCH} {indexFile}?url=/{PATH_SEARCH}/$1 [L,QSA] RewriteRule ^{PAT_COMMENTS} {indexFile}?url=/{PATH_COMMENTS}/$1 [L,QSA] -RewriteRule ^{PAT_CSS} {indexFile}?url=/$1 [L,QSA] +RewriteRule ^{PAT_CSS}$ {indexFile}?url=/$1 [L,QSA] RewriteRule ^index\.(html?|php.+) {indexFile}?url=index.html [L,QSA] RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA] #RewriteCond %{REQUEST_URI} !-U Added: trunk/include/tpl/htaccess_cgi_rewrite2.tpl =================================================================== --- trunk/include/tpl/htaccess_cgi_rewrite2.tpl (rev 0) +++ trunk/include/tpl/htaccess_cgi_rewrite2.tpl 2011-01-15 13:32:59 UTC (rev 2732) @@ -0,0 +1,51 @@ +# BEGIN s9y +ErrorDocument 404 {PREFIX}{indexFile} +DirectoryIndex {PREFIX}{indexFile} + +RewriteEngine On +RewriteBase {PREFIX} +RewriteRule ^serendipity_admin.php serendipity_admin.php [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK_AUTHORS}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK_FEEDCATEGORIES}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK_FEEDAUTHORS}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK_CATEGORIES}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^{PAT_ARCHIVES} {indexFile}?url=/{PATH_ARCHIVES}/$1.html [NC,L,QSA] +RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html {indexFile}?url=$1-article.html [L,NC,QSA] +RewriteRule ^{PAT_FEEDS}/(.*) {indexFile}?url=/{PATH_FEEDS}/$1 [L,QSA] +RewriteRule ^{PAT_UNSUBSCRIBE} {indexFile}?url=/{PATH_UNSUBSCRIBE}/$1/$2 [L,QSA] +RewriteRule ^{PAT_APPROVE} {indexFile}?url={PATH_APPROVE}/$1/$2/$3 [L,QSA] +RewriteRule ^{PAT_DELETE} {indexFile}?url={PATH_DELETE}/$1/$2/$3 [L,QSA] +RewriteRule ^{PAT_ADMIN} {indexFile}?url={PATH_ADMIN}/ [L,QSA] +RewriteRule ^{PAT_ARCHIVE} {indexFile}?url=/{PATH_ARCHIVE} [L,QSA] +RewriteRule ^{PAT_FEED} rss.php?file=$1&ext=$2 +RewriteRule ^{PAT_PLUGIN} {indexFile}?url=$1/$2 [L,QSA] +RewriteRule ^{PAT_SEARCH} {indexFile}?url=/{PATH_SEARCH}/$1 [L,QSA] +RewriteRule ^{PAT_COMMENTS} {indexFile}?url=/{PATH_COMMENTS}/$1 [L,QSA] +RewriteRule ^{PAT_CSS} {indexFile}?url=/$1 [L,QSA] +RewriteRule ^index\.(html?|php.+) {indexFile}?url=index.html [L,QSA] +RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA] +#RewriteCond %{REQUEST_URI} !-U +RewriteRule (.*\.html?) {indexFile}?url=/$1 [L,QSA] + +<Files *.tpl.php> + deny from all +</Files> + +<Files *.tpl> + deny from all +</Files> + +<Files *.sql> + deny from all +</Files> + +<Files *.inc.php> + deny from all +</Files> + +<Files *.db> + deny from all +</Files> + +# END s9y Modified: trunk/include/tpl/htaccess_rewrite.tpl =================================================================== --- trunk/include/tpl/htaccess_rewrite.tpl 2011-01-11 21:17:07 UTC (rev 2731) +++ trunk/include/tpl/htaccess_rewrite.tpl 2011-01-15 13:32:59 UTC (rev 2732) @@ -24,7 +24,7 @@ RewriteRule ^{PAT_PLUGIN} {indexFile}?url=$1/$2 [L,QSA] RewriteRule ^{PAT_SEARCH} {indexFile}?url=/{PATH_SEARCH}/$1 [L,QSA] RewriteRule ^{PAT_COMMENTS} {indexFile}?url=/{PATH_COMMENTS}/$1 [L,QSA] -RewriteRule ^{PAT_CSS} {indexFile}?url=/$1 [L,QSA] +RewriteRule ^{PAT_CSS}$ {indexFile}?url=/$1 [L,QSA] RewriteRule ^index\.(html?|php.+) {indexFile}?url=index.html [L,QSA] RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA] #RewriteCond %{REQUEST_URI} !-U Added: trunk/include/tpl/htaccess_rewrite2.tpl =================================================================== --- trunk/include/tpl/htaccess_rewrite2.tpl (rev 0) +++ trunk/include/tpl/htaccess_rewrite2.tpl 2011-01-15 13:32:59 UTC (rev 2732) @@ -0,0 +1,53 @@ +# BEGIN s9y +ErrorDocument 404 {PREFIX}{indexFile} +DirectoryIndex {PREFIX}{indexFile} +php_value session.use_trans_sid 0 +php_value register_globals off + +RewriteEngine On +RewriteBase {PREFIX} +RewriteRule ^serendipity_admin.php serendipity_admin.php [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK_AUTHORS}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK_FEEDCATEGORIES}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK_FEEDAUTHORS}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^({PAT_PERMALINK_CATEGORIES}) {indexFile}?/$1 [NC,L,QSA] +RewriteRule ^{PAT_ARCHIVES} {indexFile}?url=/{PATH_ARCHIVES}/$1.html [NC,L,QSA] +RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html {indexFile}?url=$1-article.html [L,NC,QSA] +RewriteRule ^{PAT_FEEDS}/(.*) {indexFile}?url=/{PATH_FEEDS}/$1 [L,QSA] +RewriteRule ^{PAT_UNSUBSCRIBE} {indexFile}?url=/{PATH_UNSUBSCRIBE}/$1/$2 [L,QSA] +RewriteRule ^{PAT_APPROVE} {indexFile}?url={PATH_APPROVE}/$1/$2/$3 [L,QSA] +RewriteRule ^{PAT_DELETE} {indexFile}?url={PATH_DELETE}/$1/$2/$3 [L,QSA] +RewriteRule ^{PAT_ADMIN} {indexFile}?url={PATH_ADMIN}/ [L,QSA] +RewriteRule ^{PAT_ARCHIVE} {indexFile}?url=/{PATH_ARCHIVE} [L,QSA] +RewriteRule ^{PAT_FEED} rss.php?file=$1&ext=$2 +RewriteRule ^{PAT_PLUGIN} {indexFile}?url=$1/$2 [L,QSA] +RewriteRule ^{PAT_SEARCH} {indexFile}?url=/{PATH_SEARCH}/$1 [L,QSA] +RewriteRule ^{PAT_COMMENTS} {indexFile}?url=/{PATH_COMMENTS}/$1 [L,QSA] +RewriteRule ^{PAT_CSS} {indexFile}?url=/$1 [L,QSA] +RewriteRule ^index\.(html?|php.+) {indexFile}?url=index.html [L,QSA] +RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA] +#RewriteCond %{REQUEST_URI} !-U +RewriteRule (.*\.html?) {indexFile}?url=/$1 [L,QSA] + +<Files *.tpl.php> + deny from all +</Files> + +<Files *.tpl> + deny from all +</Files> + +<Files *.sql> + deny from all +</Files> + +<Files *.inc.php> + deny from all +</Files> + +<Files *.db> + deny from all +</Files> + +# END s9y |