• [Mod] Search Engine Friendly URLs aka Short URLs 3 0 5 1
Currently:  

Author Topic: [Mod] Search Engine Friendly URLs aka Short URLs  (Read 726910 times)

0 Members and 1 Guest are viewing this topic.

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #150 on: October 28, 2005, 02:18:33 PM »
Do you have an idea which file/code could interfere  :cry:
With the origianal code of this mod erverthing is O.K. only the enxtension for the language-file causes problems in ACP

Matthias

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #151 on: October 29, 2005, 12:15:30 AM »
can you pm me with a url / login info so I could test it?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #152 on: November 06, 2005, 09:25:35 PM »
Hi V@no,
another problem  :oops: with this code
http://www.4homepages.de/forum/index.php?topic=6729.msg48487#msg48487

my category_dropdownfield is messed up
The links in the category dropdownfield are nearly O.K. only the catnumber is missing...
So every link in the category dropdownfield looks like
gpaed.de/bildergalerie/cat_english.htm
instead of
gpaed.de/bildergalerie/cat1_english.htm

Matthias

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #153 on: November 06, 2005, 09:58:58 PM »
the dropdown should add ?cat_id=1 into the url...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #154 on: November 06, 2005, 10:03:44 PM »
the dropdown should add ?cat_id=1 into the url...

Hm, do you know where I can fix it?
Matthias

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #155 on: November 06, 2005, 10:05:19 PM »
The request seems to be just fine:
Quote
http://www.gpaed.de/bildergalerie/cat_english.htm

POST /bildergalerie/cat_english.htm HTTP/1.1
Host: www.gpaed.de
Content-Type: application/x-www-form-urlencoded
Content-Length: 9
cat_id=38

:?

Are you sure it worked fine with the original modification?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #156 on: November 06, 2005, 10:12:41 PM »
Quote from: V@no
Are you sure it worked fine with the original modification?

Just tested it with the original code.
Same Problem in category dropdown? Perhabs the Problem is somewhere else  :roll:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #157 on: November 06, 2005, 10:18:18 PM »
for testing purposes, first open a page where your categories dropdown is, then add this into categories.php
Code: [Select]
echo "<pre>";
print_r($_POST);
print_r($_GET);
exit;
(above)
Code: [Select]
  header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));Then try to use dropdown. it should show you some text on blank page.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #158 on: November 06, 2005, 10:23:10 PM »
for testing purposes, first open a page where your categories dropdown is, then add this into categories.php
Code: [Select]
echo "<pre>";
print_r($_POST);
print_r($_GET);
exit;
(above)
Code: [Select]
  header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));Then try to use dropdown. it should show you some text on blank page.

The text on the blank page is
Code: [Select]
Array
(
    [cat_id] => 33
)
Array
(
    [cat_id] =>
    [page] =>
    [l] => deutsch
)


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #159 on: November 06, 2005, 10:28:51 PM »
Ok, lets call it a bug in 4images itself ;)

for now, in global.php find:
Code: [Select]
  $cat_id = (isset($HTTP_GET_VARS[URL_CAT_ID])) ? intval($HTTP_GET_VARS[URL_CAT_ID]) : intval($HTTP_POST_VARS[URL_CAT_ID]);Replace it with:
Code: [Select]
  $cat_id = (isset($HTTP_POST_VARS[URL_CAT_ID])) ? intval($HTTP_POST_VARS[URL_CAT_ID]) : intval($HTTP_GET_VARS[URL_CAT_ID]);
I'll publish complete fix in few minutes ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #160 on: November 06, 2005, 10:34:31 PM »
Hi V@no
The URL ist still without cat_number but the fix works great  8)
Thank you V@no
Matthias

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #161 on: November 06, 2005, 10:52:05 PM »
its "not possible" add cat_id into the url
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #162 on: November 13, 2005, 06:27:25 PM »
Hi V@no,
another question  :oops:
Just the same question but know in the right mod ;-)
I have aklready the extension of this mod you wrote for lapinkulta
http://www.4homepages.de/forum/index.php?topic=6729.msg48487#msg48487

This is my .htacces file
Quote
# Begin search engine friendly links code
RewriteEngine On
#RewriteBase /
RewriteRule ^lightbox(\.([0-9]+))?(_([a-zA-Z]+))?\.htm$ lightbox.php?page=$2&l=$4&%{QUERY_STRING}

RewriteRule ^search(\.([0-9]+))?(_([a-zA-Z]+))?\.htm$ search.php?page=$2&l=$4&%{QUERY_STRING}

RewriteRule ^cat([0-9]+)?(\.([0-9]+))?(_([a-zA-Z]+))?\.htm$ categories.php?cat_id=$1&page=$3&l=$5&%{QUERY_STRING}

RewriteRule ^img([0-9]+)(\.([a-zA-Z0-9]+))?(_([a-zA-Z]+))?\.htm$ details.php?image_id=$1&mode=$3&l=$5&%{QUERY_STRING}

RewriteRule ^postcard([a-zA-Z0-9]+)(_([a-zA-Z]+))?\.htm$ postcards.php?postcard_id=$1&l=$3&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)(_([a-zA-Z]+))?\.htm$ postcards.php?image_id=$1&l=$3&%{QUERY_STRING}

# End search engine friendly links code

What do I need to change to rewrite
http://www.gpaed.de/bildergalerie/cat35_deutsch.htm?page=2
to something like this
http://www.gpaed.de/bildergalerie/cat35_2_deutsch.htm

and on the home page to rewrite
http://www.gpaed.de/bildergalerie/?l=deutsch
to something like this
http://www.gpaed.de/bildergalerie/index_deutsch.htm

Matthias

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #163 on: November 15, 2005, 04:42:23 PM »
Is there no solution for my problem above  :?:

Matthias

Offline bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #164 on: November 18, 2005, 02:13:33 AM »
@matthias

could you please send  (pm) your actual .htaccess file for testing on my site.
Because i have also the same problems with the language tags in the URL.
I am interested how it would work on my site.
Perhaps we find a solution together.  :roll: