Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix htaccess setup #551

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lang/de_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ yrewrite_index_noindex_follow = Indexierung verbieten und Links folgen / nicht i

yrewrite_htaccess_hasbeenset = .htaccess-Datei wurde gesetzt/ersetzt
yrewrite_htaccess_set = .htaccess-Datei setzen
yrewrite_htaccess_hasnotbeenset = .htaccess-Datei konnte nicht gesetzt/ersetzt werden - Überprüfe die Schreibrechte

yrewrite_htaccess_info = Um YRewrite in Betrieb zu nehmen, wird eine .htaccess-Datei im Root-Ordner erstellt. Ist eine andere .htaccess-Datei bereits vorhanden, wird diese ersetzt. Bitte ggf. die .htaccess-Datei vorher sichern.

Expand Down
2 changes: 1 addition & 1 deletion lib/yrewrite/yrewrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ public static function readPathFile()

public static function copyHtaccess()
{
rex_file::copy(rex_path::addon('yrewrite', 'setup/.htaccess'), rex_path::frontend('.htaccess'));
return (rex_file::copy(rex_path::addon('yrewrite', 'setup/.htaccess'), rex_path::frontend('.htaccess')));
}

public static function isHttps()
Expand Down
7 changes: 5 additions & 2 deletions pages/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
echo rex_view::error(rex_i18n::msg('csrf_token_invalid'));
} else {
if ('htaccess' == $func) {
rex_yrewrite::copyHtaccess();
echo rex_view::success($this->i18n('htaccess_hasbeenset'));
if (rex_yrewrite::copyHtaccess()) {
echo rex_view::success($this->i18n('htaccess_hasbeenset'));
} else {
echo rex_view::error($this->i18n('htaccess_hasnotbeenset'));
}
}
}
}
Expand Down