Welcome to Geeklog, Anonymous Thursday, November 21 2024 @ 10:17 am EST

Geeklog Forums

Sorter URL


Status: offline

alb3rt

Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
I'm testing wiht url, I created some staticpages y I'll like to use url like wordpress (https://website/page). I added into htacces:

Text Formatted Code
RewriteRule ^(.+) /staticpages/index.php?page=$1 [L]
 

This works well, but when I enable the multilanguage (switchlang) I have a mistake because I can't redirect the page (I have staticpage in two languages "_es" and "_en"Wink.

I mean, I can't redirect http://website/page_es top http://website/page_en, of course I know that is neccesary to modify switchlang.php but I have no idea.

Thanks.
D Web Studio - www.d-webstudio.net
 Quote

Status: offline

alb3rt

Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
This was fixed, I just activated "rewrite" in config Big Grin
D Web Studio - www.d-webstudio.net
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
You can also play with the 404.php page

Text Formatted Code
require_once 'lib-common.php';

if (isset($_SERVER['SCRIPT_URI'])) {
    $url = strip_tags($_SERVER['SCRIPT_URI']);
} else {
    $pos = strpos($_SERVER['REQUEST_URI'], '?');
    if ($pos === false) {
        $request = $_SERVER['REQUEST_URI'];
    } else {
        $request = substr($_SERVER['REQUEST_URI'], 0, $pos);
    }
    $url = 'http://' . $_SERVER['HTTP_HOST'] . strip_tags($request);
}
$request_page = substr($url, strlen($_CONF['site_url'])+1);
$staticpage = DB_getItem( $_TABLES['staticpage'], 'sp_id', "sp_id='$request_page'" );
if ($staticpage != '') {
    $display = COM_siteHeader('menu', DB_getItem( $_TABLES['staticpage'], 'sp_title', "sp_id='$request_page'" ));
    $display .= PLG_replaceTags('[staticpage_content:' . $staticpage . ']');
} else {
    $display = COM_siteHeader('menu', $LANG_404[1]);
        $display .= COM_startBlock($LANG_404[1]);
        $display .= sprintf($LANG_404[2], $url);
        $display .= $LANG_404[3];
        $display .= COM_endBlock();
}
$display .= COM_siteFooter();

COM_output($display);


Like this the if the url you want to reach is http://mysite.com/mypage and the staticpage with id mypage exists the 404.php display this page.

Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
Quote by: alb3rt

This was fixed, I just activated "rewrite" in config Big Grin



Add you comment the line in htaccess and enable the "rewrite" in config, but I try to enter and not enter https://midomian.com/pagestaticname send me the 404 error. Need more?

Greetings!! Mr. Green
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
To activate redirection to your 404.php page you need to add the code below in your .htaccess file

Text Formatted Code

ErrorDocument 404 /404.php
 


Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
This is mi file htaccess

Text Formatted Code

ErrorDocument 404 /404.php
RewriteRule ^(.+) /staticpages/index.php?page=$1 [L]
php_flag register_globals Off
php_flag log_errors On
php_flag file_uploads On
php_value display_errors Off
php_value upload_max_filesize 6M
php_value memory_limit 16M
 



I have a static page with this link:

http://www.koalasoftmx.tk/staticpages/index.php/bloquear-facebook-meebo-imo-443-https

It is assumed that by entering this code to my htaccess file, you should now enter as:

http://www.koalasoftmx.tk/bloquear-facebook-meebo-imo-443-https

is that correct?, because if so I come and send me 404 error page.

**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
You stay, there was no code added: Bend, thank's

This can apply equally to the articles? would they?

Text Formatted Code
RewriteRule ^(.+) /article.php?story=$1 [L]


Greetings!! Mr. Green
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

All times are EST. The time is now 10:17 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content