This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if ($modx->event->name == 'OnWebPagePrerender') { | |
| $_url = parse_url($_SERVER['REQUEST_URI']); | |
| if($modx->resource->isfolder && !preg_match("/\/$/", $_url['path'])) { | |
| $id = $modx->resource->id; | |
| $url = isset($_url['query']) ? $modx->makeUrl($id, '', $_url['query']) : $modx->makeUrl($id); | |
| $modx->sendRedirect($url, ['responseCode' => 'HTTP/1.1 301 Moved Permanently']); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Конвертер вызовов сниппетов MODX</title> | |
| <style> | |
| body { font-family: Arial, sans-serif; max-width: 800px; margin: 20px auto; padding: 0 20px; } | |
| textarea { width: 100%; height: 200px; margin-bottom: 10px; font-family: monospace; } | |
| .button-group { display: flex; gap: 10px; margin-bottom: 10px; } | |
| button { padding: 10px 20px; background: #4CAF50; color: white; border: none; cursor: pointer; border-radius: 4px; } | |
| button:hover { background: #45a049; } |
OlderNewer