e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 214 forks source link

Feature Request: URL SELF for SITE LINKS #3899

Closed chory closed 5 years ago

chory commented 5 years ago

Please, a link of the type http://www.dominio.com/e107_plugins/pluginname/page.php, is not viable or attractive and very long to remember or share

Moc commented 5 years ago

Check your URL configuration, there are already plenty of options for Search Engine Friendly URLs.

Admin Area > Settings > URL configuration. If you have selected friendly URLs there, you can use those in Sitelinks.

For plugins, you can make use of the e_url.php addon. Examples are in several plugins, including the _blank one. You can also check my Wrapper plugin for a simple example.

chory commented 5 years ago

Mod-rewrite is disabled. To enable, please add the following line to your e107_config.php file: Sorry. But does it work with jquery and ajax? It doesn't show me the page as it should.

chory commented 5 years ago

http://www.clan-toro.es/e107_plugins/clan/servidorSandstorm.php << Works OK http://www.clan-toro.es/clan/sandstorm << it does not work

Moc commented 5 years ago

Several things to check:

Ajax and jQuery are not likely to be related to this issue.

Jimmi08 commented 5 years ago

@Moc Ajax/ JS can be a problem. with SEF-URL page URL is changed and if ajax or js use relative URLs, they will stop to work (or better they call the wrong path) If you check the console, there are errors about this

image

In fact, I think that I asked a similar question some years ago without an answer.

chory commented 5 years ago

@Jimmi08 Yes, I have already seen the error. I will have to look at how to solve it. Thank you very much, if I find out I will share it.

LaocheXe commented 5 years ago

could it be an issue within the plugin e_url.php???

Maybe not coded right?

`class awards_url // plugin-folder + '_url' { function config() { $config = array();

    $config['awards'] = array(
        'alias'         => 'awards',
        'regex'         => '^{alias}(.*)$',
        'sef'           => '{alias}/awards',
        'redirect'      => '{e_PLUGIN}awards/awards.php'            
    );

    return $config;
}`

that would point to https://501stlegion-a3.com/awards

'sef' => '{alias}/clan/sandstorm', 'sef' => '{alias}/clan/'.$ClanName.'',

Jimmi08 commented 5 years ago

@LaocheXe That example looks correct, but that line with'sef' => '{alias}/clan/'.$ClanName.'', not. Is this another plugin for clans?

Moc commented 5 years ago

@jimmi08 i understand, but as chory is getting a warning about mod rewrite in the admin area, I think it is more likely to be a server configuration or htaccess issue

LaocheXe commented 5 years ago

@Jimmi08 I don't know, was just giving an example of how I would do it

chory commented 5 years ago

@Moc The warning is fixed. Now I have to look at how to make AJAX load the file it calls correctly.

@Jimmi08 clan, it has no plugin

chory commented 5 years ago

Solved http://www.clan-toro.es/sandstorm `class clan_url {

function config()
{
    $config = array();

    $config['sandstorm'] = array(
        'regex'         => '^sandstorm/?',
        'sef'           => 'sandstorm',
        'redirect'      => '{e_PLUGIN}clan/servidorSandstorm.php',
    );      
/*File called from {e_PLUGIN}clan/servidorSandstorm.php*/ $config['ñaca'] = array( 'regex' => '%C3%B1aca.php', 'sef' => '%C3%B1aca.php', 'redirect' => '{e_PLUGIN}clan/ñaca.php' ); /* File called from ñaca.php */ $config['XXXX'] = array( 'regex' => 'XXXX.php', 'sef' => 'XXXX.php', 'redirect' => '{e_PLUGIN}clan/XXXX.php' ); return $config; } }`
Jimmi08 commented 5 years ago

So you added "e107 internal redirects" for ajax calls? It's very bad name for this, it's not "redirect" but you know what I mean. If yes, I need to decide if this is terrific or brilliant :)

Hm, on second thoughts, easy and brilliant, you let on e107 SEF-URL system to "offer" content on different URL for ajax call. I will test this when I will have time with old clanmembers plugins. Thanks for sharing.

chory commented 5 years ago

A pleasure to help with something