Clean URLs

Please post answers on the most frequently asked questions about CMSimple
Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

Простите, но так красивее.

Post by Maxim » Fri Jul 05, 2013 8:15 am

> When I go back to the main page "/Welcome_to_CMSimple_XH" and would be "/"
>> Added ".html" the transition to the main page does not work. "/.html" "...404 Not Found..."
>>> It doesn't seem to possible to rewrite /.html at all. That is probably related to .html is treated as a hidden file by Apache (similar to .htaccess) and these file can't be accessed. I don't know if there's any way to change this.

[ external image ] Здравствуйте.
Простите, но я передумал, так:
"/Welcome-to-CMSimple_XH.html" - красивее

Code: Select all

function a($i, $x) {
    global $sn, $u, $cf, $adm;
    if ($i == 0 && !$adm) {
        if ($x == '' && $cf['locator']['show_homepage'] == 'true') {
            return '<a href="' . $sn . $u[0] . '.html">';
        }
    }
    return isset($u[$i]) ? '<a href="' . $sn . $u[$i] . '.html' . (!empty($x) ? '?' . $x : '') . '">' : '<a href="' . $sn . '.html' . (!empty($x) ? '?' . $x : '') . '">';
}
Создал сбору "CMSimple_XH_157_CleanURLs" и обновление "Update_CMSimple_XH_157_CleanURLs"
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html

[ external image ] Hello.
Sorry, but I changed my mind, so:
"/Welcome-to-CMSimple_XH.html" - beautiful

Code: Select all

function a($i, $x) {
    global $sn, $u, $cf, $adm;
    if ($i == 0 && !$adm) {
        if ($x == '' && $cf['locator']['show_homepage'] == 'true') {
            return '<a href="' . $sn . $u[0] . '.html">';
        }
    }
    return isset($u[$i]) ? '<a href="' . $sn . $u[$i] . '.html' . (!empty($x) ? '?' . $x : '') . '">' : '<a href="' . $sn . '.html' . (!empty($x) ? '?' . $x : '') . '">';
}
Created collection "CMSimple_XH_157_CleanURLs" and update "Update_CMSimple_XH_157_CleanURLs"
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html
Last edited by Maxim on Wed Jan 20, 2016 6:25 am, edited 2 times in total.
Simple Hosting
Бедная, бросаемая бурею, безутешная!

Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

Удалил файлы "config.php" и "defaultconfig.php".

Post by Maxim » Mon Jul 08, 2013 4:48 am

[ external image ] Здравствуйте.
Удалил файлы "config.php" и "defaultconfig.php" из "Update_CMSimple_XH_157_CleanURLs".

[ external image ] Hello.
Deleted the files "config.php" and "defaultconfig.php" in the "Update_CMSimple_XH_157_CleanURLs".
Last edited by Maxim on Tue Feb 04, 2014 6:18 am, edited 1 time in total.
Simple Hosting
Бедная, бросаемая бурею, безутешная!

Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

Создал Addon, но "Sitemap" не работает, поможете?

Post by Maxim » Tue Sep 03, 2013 9:16 am

[ external image ] Здравствуйте.
Создал Addon, но "Sitemap" не работает, поможете?
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html

[ external image ] Hello.
Created Addon, but "Sitemap" does not work, any help?
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html

[ external image ] Guten Tag.
Erstellt Addon, aber die "Sitemap" nicht funktioniert, helfen?
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html
Last edited by Maxim on Wed Jan 20, 2016 6:25 am, edited 2 times in total.
Simple Hosting
Бедная, бросаемая бурею, безутешная!

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Clean URLs

Post by cmb » Tue Sep 03, 2013 11:05 am

Hi Maxim,
Maxim wrote:Создал Addon, но "Sitemap" не работает, поможете?
That is caused by a change in CMSimple_XH 1.5.8 (see http://cmsimpleforum.com/viewtopic.php?f=29&t=6058 for details).

Solution: in cms.php line 232ff:

Code: Select all

foreach (array('login', 'mailform', 'print', 'sitemap') as $i) {
    if (!empty($GLOBALS[uenc($tx['menu'][$i])])) {
        $$i = 'true';
        $su = '';
    }
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

Спасибо!!!

Post by Maxim » Tue Sep 03, 2013 12:03 pm

[ external image ] Спасибо!!!

<?php echo homelink();?> - не работает :cry:
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html

[ external image ] Thank You!!!

<?php echo homelink();?> - does not work :cry:
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html
Last edited by Maxim on Wed Jan 20, 2016 6:26 am, edited 2 times in total.
Simple Hosting
Бедная, бросаемая бурею, безутешная!

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Clean URLs

Post by cmb » Tue Sep 03, 2013 12:23 pm

Maxim wrote:<?php echo homelink();?> - не работает :cry:
As far as I know, homelink() is not part of CMSimple(_XH). You can use the following instead:

Code: Select all

<?php echo a(0, ''), $tx['locator']['home'], '</a>';?>
Alternatively you can define function homelink() in cmsimple/userfuncs.php:

Code: Select all

function homelink()
{
    global $tx;

    return a(0, '') . $tx['locator']['home'] . '</a>';
}
Christoph M. Becker – Plugins for CMSimple_XH

Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

Sitemap > Home >

Post by Maxim » Tue Sep 03, 2013 12:44 pm

[ external image ] Внизу страницы пишет "Sitemap > Home > " - как исправить или удалить?
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html

[ external image ] At the bottom of the page says "Sitemap > Home > " - how to fix or remove?
http://foxpro.maxim.zp.ua/saytostroenie ... -urls.html
Last edited by Maxim on Wed Jan 20, 2016 6:26 am, edited 2 times in total.
Simple Hosting
Бедная, бросаемая бурею, безутешная!

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Clean URLs

Post by cmb » Tue Sep 03, 2013 12:52 pm

Maxim wrote:Внизу страницы пишет "Sitemap > Home > " - как исправить или удалить?
:? Can you provide a screenshot, please.
Christoph M. Becker – Plugins for CMSimple_XH

Maxim
Posts: 121
Joined: Thu Jun 13, 2013 6:52 am
Location: Запорожье
Contact:

Sitemap.jpg

Post by Maxim » Tue Sep 03, 2013 1:00 pm

Last edited by Maxim on Wed Jan 20, 2016 6:27 am, edited 1 time in total.
Simple Hosting
Бедная, бросаемая бурею, безутешная!

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Clean URLs

Post by cmb » Tue Sep 03, 2013 1:20 pm

Hmm, it looks like you have modified the template. Have you changed the following?

Code: Select all

<map name="m_template_r1_c4" id="m_template_r1_c4">
    <area shape="poly" coords="62,21,84,21,84,43,62,43,62,21" href="?sitemap" alt="">
    <area shape="poly" coords="93,21,115,21,115,43,93,43,93,21" href="?mailform" alt="">
    <area shape="poly" coords="32,21,54,21,54,43,32,43,32,21" href="index.php" alt="">
  </map>
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply