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

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

0 Members and 1 Guest are viewing this topic.

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #240 on: March 24, 2006, 01:48:20 PM »
hmmmm  :?

I too was interested to find a way  to remove session IDs completely... like the very first time homepage loads, all links have this session IDs and if u click on any links, the second time page loads, we get clean links without session IDs, this ok ;) but the worse thing is all pages that get indexed by search engines have this session IDs  :?

 :idea: v@no's previous idea on how to remove it is promising...
 :!: he has also mentioned the disadvantages of it, which is discouraging to apply it...

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 #241 on: March 24, 2006, 02:10:54 PM »
i allready tried this but it dont work ...

i just checked google cache and saw what it see .... sessions are evrywhere ...
google cache? google store cache pages almost forever. you still can find cached pages of this site dated more then a year ago, even before the hack!
what did you expect?
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 Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #242 on: March 24, 2006, 02:24:45 PM »
Hi V@no
Quote
You suggested a way to remove session IDs for search bots. Right here
http://www.4homepages.de/forum/index.php?topic=6729.msg59251#msg59251


i allready tried this but it dont work ...

i just checked google cache and saw what it see .... sessions are evrywhere ...


The best way to know;  what you have applied is working or not; is to load the page in your browser and hover over the category links and see if there is any session ID attached.

Checked in google cache will not help like v@no said….
and for that matter checking your site in search will not help momentarily, cause even if you site/page is re-indexed today. It takes days to get reflected in search results…..

so if you do not find any session id attached, then you are doing it correct… wait for few weeks or months to see the results without the session ID in search listings…


Offline Fastian

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #243 on: March 24, 2006, 04:04:53 PM »
:idea: v@no's previous idea on how to remove it is promising...
 :!: he has also mentioned the disadvantages of it, which is discouraging to apply it...

That’s why I am also interested in it. And about the disadvantage, I have worked it out. I mean Let the bot once crawle your site without session ID  :wink:

Hi V@no

I am using kief24   version of this mod (page 14)
http://www.4homepages.de/forum/index.php?topic=6729.msg57268#msg57268

In his modification, he has commented out this line.
Code: [Select]
if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {

So what should I do to apply the changes u suggested for Bots??

What to change in this version to use this mod?
I m not a  Programmer.
          But
I m a Good Learner.

Offline commandos

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
    • Quran Recitation
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #244 on: March 24, 2006, 08:11:57 PM »
Quote
google cache? google store cache pages almost forever. you still can find cached pages of this site dated more then a year ago, even before the hack!
what did you expect?


google give you the date of the cache ... when it was taken so you can know what it see ....


Quote
This is G o o g l e's cache of http://www. as retrieved on 19 Mar 2006 05:14:50 GMT


Offline commandos

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
    • Quran Recitation
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #245 on: March 29, 2006, 05:37:17 AM »
gr8 help !!!!

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #246 on: March 29, 2006, 10:42:27 AM »
gr8 help !!!!

@ commandos

Pl don’t get dishearten, this MOD is one of the most popular MOD here and there are virtually thousands of people trying to find the best configuration. I am also desperately looking for this information you are looking for! All I can tell is; let us wait and see, surely some one will come up with some idea ;)

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 #247 on: March 29, 2006, 03:05:08 PM »
let us wait and see, surely some one will come up with some idea ;)
I have another idea: lets try and one more try. The code I've showed worked on my test server and others reported it worked. So, the solution is - try try try ;)
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 tirakle

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #248 on: April 02, 2006, 11:58:12 AM »
Is this mod also for the new version 1.7.2 ?

I tried to change the codes but they are different ( includes/sessions.php ) and it is not working.

Has anybody tried it successfully ?

Offline himu

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • Point Of View
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #249 on: April 03, 2006, 08:01:22 AM »
Hey v@no can you help me  :oops:
I was trying this without sucess:

Replace /member.php?action=uploadform with /upload
and Replace member.php?action=uploadform&cat_id=cat_id with /uploadcat_id[/b]

Example: /upload31 (where 31 is the cat id) -- like your site  :wink:

this is what i have done so far:
in .htaccess file (added):
Code: [Select]
RewriteRule ^upload$ member.php?action=uploadform%{QUERY_STRING}
RewriteRule ^upload\.([0-9]+)$ member.php?action=uploadform&cat_id=$1&%{QUERY_STRING}

in sessions.php file (added):
Code: [Select]
      elseif (strstr($url, 'member.php?action=uploadform')) {
        if (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('member.php?action=uploadform', 'upload'.$matches[1], $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('member.php?action=uploadform', 'upload', $url);
        }
      }

What did i do wrong ? :?: :roll:

Offline zoomos

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #250 on: April 03, 2006, 03:04:37 PM »
How would I change

{prev_image_url} and {next_image_url}  so it will work with mod_rewrite

and {paging}

Help v@no, you like a god in this forum lol

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 #251 on: April 04, 2006, 12:50:55 AM »
@himu:
Try this:
Code: [Select]
      elseif (strstr($url, 'member.php?action=uploadform'))
      {
        preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
        $url_cat_id = "";
        if (isset($matches[1]))
        {
          $url_cat_id = $matches[1];
        }
        $split = explode('?', $url);
        $url = $split[0];
        $query = @$split[1];
        $url   = str_replace('member.php', 'upload'.$url_cat_id, $url);
        $query = str_replace('cat_id='.$url_cat_id.'&', '', $query);
        $query = str_replace('&cat_id='.$url_cat_id, '', $query);
        $query = str_replace('cat_id='.$url_cat_id, '', $query);
        $query = str_replace('action=uploadform&', '', $query);
        $query = str_replace('&action=uploadform', '', $query);
        $query = str_replace('action=uploadform', '', $query);
        if (!empty($query)) {
            $url .= '?' . $query;
        }
      }

and in .htaccess you can use only one line:
Code: [Select]
RewriteRule ^upload([0-9]*)$ member.php?action=uploadform&cat_id=$1&%{QUERY_STRING}

@zoomos:
I dont understand what do you mean...
If you added the code for image details page, it will affect next/prev links as well.
« Last Edit: April 05, 2006, 08:49:13 AM by V@no »
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 himu

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • Point Of View
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #252 on: April 05, 2006, 07:30:49 AM »
V@no,
 :( Unfortunately this did and did not work also... let me explain...

when i click on upload under any category it shows /member.php?action=uploadform&cat_id=10
but when i manually type upload10 it works... why??  :roll:

the hyperlinks are not changing ... why is that? any clues...  :?:

@himu:
Try this ------- snip snip .....

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 #253 on: April 05, 2006, 08:19:40 AM »
perhaps you added this code below the member.php part that was already exists? can you show your url() function?
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 himu

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • Point Of View
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #254 on: April 05, 2006, 08:25:08 AM »
perhaps you added this code below the member.php part that was already exists? can you show your url() function?

Here is my function url():
Code: [Select]
  function url($url, $amp = "&") {
    global $l, $user_info;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];
    $url = str_replace('&', '&', $url);
    if (!defined('IN_CP')) {
      if (strstr($url, 'index.php')) {
        $url = str_replace('index.php', './', $url);
      }
      elseif (strstr($url, 'search.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('search.php', 'search'.$matches[1], $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('search.php', 'search', $url);
        }
      }
      elseif (strstr($url, 'lightbox.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('lightbox.php', 'album'.$matches[1], $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('lightbox.php', 'album', $url);
        }
      }

// myMOD upload string
      elseif (strstr($url, 'member.php?action=uploadform'))
      {
        preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
        $url_cat_id = "";
        if (isset($matches[1]))
        {
          $url_cat_id = $matches[1];
        }
        $split = explode('?', $url);
        $url = $split[0];
        $query = @$split[1];
        $url   = str_replace('member.php?action=uploadform', 'upload'.$url_cat_id, $url);
        $query = str_replace('cat_id='.$url_cat_id.'&', '', $query);
        $query = str_replace('&cat_id='.$url_cat_id, '', $query);
        $query = str_replace('cat_id='.$url_cat_id, '', $query);
        if (!empty($query)) {
            $url .= '?' . $query;
        }
      }
// myMOD upload string END

      elseif (strstr($url, 'categories.php')) {
        if (strstr($url, 'cat_id=') && strstr($url, 'page=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#page=([0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'c'.$matches1[1].'.'.$matches2[1], $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'c'.$matches[1], $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'c', $url);
        }
      }
      elseif (strstr($url, 'details.php?image_id=')) {
        if (strstr($url, 'image_id=') && strstr($url, 'mode=')) {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#mode=([a-zA-Z0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', $matches1[1].'.'.$matches2[1], $url);
            $query = str_replace('image_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches1[1], '', $query);
            $query = str_replace('image_id='.$matches1[1], '', $query);
            $query = str_replace('mode='.$matches2[1].'&', '', $query);
            $query = str_replace('&mode='.$matches2[1], '', $query);
            $query = str_replace('mode='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', $matches[1], $url);
            $query = str_replace('image_id='.$matches[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches[1], '', $query);
            $query = str_replace('image_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
      }
      elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
    }
    if ($this->mode == "get" && strstr($url, $this->session_id)) {
      $url .= strpos($url, '?') !== false ? '&' : '?';
      $url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty($l)) {
      $url .= strpos($url, '?') ? '&' : '?';
      $url .= "l=".$l;
    }
    $url = str_replace('&', $amp, $url);
    $url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return $url;
  }