Generate .htaccess and added rewritebase
This commit is contained in:
parent
2bc925cced
commit
c59348ce98
|
@ -5,6 +5,9 @@ AddDefaultCharset UTF-8
|
||||||
# Enable rewrite rules
|
# Enable rewrite rules
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
|
|
||||||
|
# Base directory
|
||||||
|
RewriteBase /
|
||||||
|
|
||||||
# Deny direct access to .txt files
|
# Deny direct access to .txt files
|
||||||
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]
|
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,6 @@ class Text {
|
||||||
'и'=>'i', 'й'=>'j', 'к'=>'k', 'л'=>'l', 'м'=>'m', 'н'=>'n', 'о'=>'o','п'=>'p',
|
'и'=>'i', 'й'=>'j', 'к'=>'k', 'л'=>'l', 'м'=>'m', 'н'=>'n', 'о'=>'o','п'=>'p',
|
||||||
'р'=>'r', 'с'=>'s', 'т'=>'t', 'у'=>'u', 'ф'=>'f', 'х'=>'h', 'ц'=>'c', 'ч'=>'ch',
|
'р'=>'r', 'с'=>'s', 'т'=>'t', 'у'=>'u', 'ф'=>'f', 'х'=>'h', 'ц'=>'c', 'ч'=>'ch',
|
||||||
'ш'=>'sh', 'щ'=>'sh', 'ъ'=>'', 'ь'=>'j', 'ю'=>'yu', 'я'=>'ya',
|
'ш'=>'sh', 'щ'=>'sh', 'ъ'=>'', 'ь'=>'j', 'ю'=>'yu', 'я'=>'ya',
|
||||||
|
|
||||||
// Ukrainian
|
// Ukrainian
|
||||||
'Є'=>'Ye', 'І'=>'I', 'Ї'=>'Yi', 'Ґ'=>'G',
|
'Є'=>'Ye', 'І'=>'I', 'Ї'=>'Yi', 'Ґ'=>'G',
|
||||||
'є'=>'ye', 'і'=>'i', 'ї'=>'yi', 'ґ'=>'g',
|
'є'=>'ye', 'і'=>'i', 'ї'=>'yi', 'ґ'=>'g',
|
||||||
|
|
|
@ -44,7 +44,7 @@ class pluginTinymce extends Plugin {
|
||||||
paste_as_text: true,
|
paste_as_text: true,
|
||||||
document_base_url: "'.DOMAIN_UPLOADS.'",
|
document_base_url: "'.DOMAIN_UPLOADS.'",
|
||||||
plugins: [
|
plugins: [
|
||||||
"autosave",
|
"autosave, code",
|
||||||
"searchreplace autolink directionality",
|
"searchreplace autolink directionality",
|
||||||
"visualblocks visualchars",
|
"visualblocks visualchars",
|
||||||
"fullscreen image link media template",
|
"fullscreen image link media template",
|
||||||
|
@ -52,7 +52,8 @@ class pluginTinymce extends Plugin {
|
||||||
"advlist lists textcolor wordcount",
|
"advlist lists textcolor wordcount",
|
||||||
"contextmenu colorpicker textpattern"
|
"contextmenu colorpicker textpattern"
|
||||||
],
|
],
|
||||||
toolbar: "restoredraft | formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat image table | pagebreak code fullscreen"
|
toolbar1: "restoredraft | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | outdent indent | removeformat image | pagebreak code",
|
||||||
|
toolbar2: "formatselect | table | numlist bullist | fullscreen"
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>';
|
</script>';
|
||||||
|
|
|
@ -190,7 +190,7 @@ function checkSystem()
|
||||||
$stdOut = array();
|
$stdOut = array();
|
||||||
$dirpermissions = 0755;
|
$dirpermissions = 0755;
|
||||||
|
|
||||||
// Try to create .htaccess file if not exists
|
// Try to create .htaccess
|
||||||
$htaccessContent = 'AddDefaultCharset UTF-8
|
$htaccessContent = 'AddDefaultCharset UTF-8
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
|
@ -198,6 +198,9 @@ function checkSystem()
|
||||||
# Enable rewrite rules
|
# Enable rewrite rules
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
|
|
||||||
|
# Base directory
|
||||||
|
RewriteBase '.HTML_PATH_ROOT.'
|
||||||
|
|
||||||
# Deny direct access to .txt files
|
# Deny direct access to .txt files
|
||||||
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]
|
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]
|
||||||
|
|
||||||
|
@ -207,7 +210,6 @@ RewriteRule ^(.*) index.php [PT,L]
|
||||||
|
|
||||||
</IfModule>';
|
</IfModule>';
|
||||||
|
|
||||||
if ( !file_exists(PATH_ROOT.'.htaccess') || (filesize(PATH_ROOT.'.htaccess')<1) ) {
|
|
||||||
if (!file_put_contents(PATH_ROOT.'.htaccess', $htaccessContent)) {
|
if (!file_put_contents(PATH_ROOT.'.htaccess', $htaccessContent)) {
|
||||||
if (!empty($_SERVER['SERVER_SOFTWARE'])) {
|
if (!empty($_SERVER['SERVER_SOFTWARE'])) {
|
||||||
$webserver = Text::lowercase($_SERVER['SERVER_SOFTWARE']);
|
$webserver = Text::lowercase($_SERVER['SERVER_SOFTWARE']);
|
||||||
|
@ -221,7 +223,7 @@ RewriteRule ^(.*) index.php [PT,L]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Check mod_rewrite module
|
// Check mod_rewrite module
|
||||||
if (function_exists('apache_get_modules') ) {
|
if (function_exists('apache_get_modules') ) {
|
||||||
|
|
Loading…
Reference in New Issue