• [MOD] Google Friendly Urls For 4images Best Seo Mod 4 0 5 1
Currently:  

Author Topic: [MOD] Google Friendly Urls For 4images Best Seo Mod  (Read 603682 times)

0 Members and 1 Guest are viewing this topic.

Offline Szooguun

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #465 on: September 19, 2013, 03:33:27 PM »
Welcome. Sorry for my English. Mod works great.

However, Google have hundreds of thousands of indexed pages in standard format: / details.php? Image_id =, / categories.php? Image_id =, etc. Is there a way that the original links lead to new urls? I do not want to block the old urls in robots.txt and the new index the entire page.

The second problem is to edit the name of the photo or category.

We have, for example, an image with the name "Test"

Change the name of the photo on: test2

I now work earlier link: / img-test-123.htm and in addition there is another link: / img-test2-123.htm

For Google, it will appear as a copy. What to do to address / img-test-123.htm was redirected to the new address / img-test2-123.htm?

And the same question about the category after the name change.

Offline Szooguun

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #466 on: October 09, 2013, 03:28:49 PM »
Nobody is able to help me? Please help!

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #467 on: December 04, 2013, 09:04:22 AM »
Since we are on optimizing rage today, little more optimized nic_bck's version:

Code: [Select]
function fixname($text)
{
  return strtolower(strtr(
    $text,
     array(
      "" => "e",
      "" => "e",
      "" => "e",
      "" => "a",
      "" => "e",
      "" => "a",
      "" => "a",
      "" => "o",
      "" => "i",
      "" => "a",

      //russian UTF8 encoded alphabet (lower and upper cases)
      "А" => "a",
      "а" => "a",
      "Б" => "b",
      "б" => "b",
      "В" => "v",
      "в" => "v",
      "Г" => "g",
      "г" => "g",
      "Д" => "d",
      "д" => "d",
      "Е" => "e",
      "е" => "e",
      "Ё" => "yo",
      "ё" => "yo",
      "Ж" => "zh",
      "ж" => "zh",
      "З" => "z",
      "з" => "z",
      "И" => "i",
      "и" => "i",
      "Й" => "j",
      "й" => "j",
      "К" => "k",
      "к" => "k",
      "Л" => "l",
      "л" => "l",
      "М" => "m",
      "м" => "m",
      "Н" => "n",
      "н" => "n",
      "О" => "o",
      "о" => "o",
      "П" => "p",
      "п" => "p",
      "Р" => "r",
      "р" => "r",
      "С" => "s",
      "с" => "s",
      "Т" => "t",
      "т" => "t",
      "У" => "u",
      "у" => "u",
      "Ф" => "f",
      "ф" => "f",
      "Х" => "h",
      "х" => "h",
      "Ц" => "c",
      "ц" => "c",
      "Ч" => "ch",
      "ч" => "ch",
      "Ш" => "sh",
      "ш" => "sh",
      "Щ" => "sch",
      "щ" => "sch",
      "Ъ" => "",
      "ъ" => "",
      "Ы" => "i",
      "ы" => "i",
      "Ь" => "'",
      "ь" => "'",
      "Э" => "e",
      "э" => "e",
      "Ю" => "yu",
      "ю" => "yu",
      "Я" => "ya",
      "я" => "ya",
  )));
}
function get_category_url($cat_id,$cat_url = '')
{
  global $site_db, $cat_cache;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$cat_id]))
    return $urlname[$cat_id];
  if (!empty($cat_cache))
  {
    $row['cat_name'] = @$cat_cache[$cat_id]['cat_name'];
    $row['cat_parent_id'] = @$cat_cache[$cat_id]['cat_parent_id'];
  }
  else
  {
    $sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
    $row = $site_db->query_firstrow($sql);
  }
  $row['cat_name'] = fixname($row['cat_name']);
  $cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
  // if you want full path of category in url, put next line in comment
  $row['cat_parent_id'] = 0;
  if($row['cat_parent_id'] != 0)
  {
    $urlname[$cat_id] = get_category_url($row['cat_parent_id'],$cat_url);
  }
  else
  {
    $urlname[$cat_id] = $cat_url;
  }
  return $urlname[$cat_id];
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
  global $site_db;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$image_id]))
    return $urlname[$image_id];
 
  $sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
  $row = $site_db->query_firstrow($sql);
  $row['image_name'] = fixname($row['image_name']);
  // if you want comlpete path to image in url, remove comment from following line
  //$urlname[$image_id] = get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id; 
  $urlname[$image_id] = '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
  return $urlname[$image_id];
}


Results:

index.php
Original
Code: [Select]
Page generated in 0.109686 seconds with 36 queries, spending 0.059000 seconds doing MySQL queries and 0.050686 doing PHP things. GZIP compression disabledOptimized
Code: [Select]
Page generated in 0.095068 seconds with 11 queries, spending 0.059000 seconds doing MySQL queries and 0.036068 doing PHP things. GZIP compression disabled
categories.php (30 images per page)
Original:
Code: [Select]
Page generated in 0.227558 seconds with 195 queries, spending 0.051000 seconds doing MySQL queries and 0.176558 doing PHP things. GZIP compression disabledOptimized:
Code: [Select]
Page generated in 0.179981 seconds with 37 queries, spending 0.050000 seconds doing MySQL queries and 0.129981 doing PHP things. GZIP compression disabled
details.php
Original
Code: [Select]
Page generated in 0.219341 seconds with 22 queries, spending 0.110000 seconds doing MySQL queries and 0.109341 doing PHP things. GZIP compression disabledOptimized
Code: [Select]
Page generated in 0.060998 seconds with 14 queries, spending 0.028000 seconds doing MySQL queries and 0.032998 doing PHP things. GZIP compression disabled

Many thanks V@no for this great optimization'!!'  :thumbup:

Offline wallward

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #468 on: February 19, 2014, 10:31:05 AM »
How remove at, with, in, to from url

Offline wflorian

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #469 on: February 20, 2014, 09:58:54 PM »
hi guys.

i have problems getting the mod working for some special polish characters which are UTF8. sadly there seems no really easy working solution yet :(

i am trying to add a character like "ł" (ł) to the sessions.php:


//Mod_bmollet
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function fixname($text)
{
  return 
strtolower(strtr(
    
$text,
     array(
      
"" => "e",
      
"ł" => "l",


after the insertion of the character "ł" i have to save the file as UTF8. after this the replacing of the sepcial characters at all does not work anymore for the google friendly URLs.

Is there no possible work around to solve this issue? I would be willing to pay for some working help! :(

looking forward to somebody who can help!

Offline nameless

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #470 on: June 09, 2014, 03:06:53 PM »
I need some help

i have the cat name in Arabic lang
I'm using 4image 1.7.11

so the URL is like this
http://www.arabmobile.mobi/sklans/cat-%C7%CE%C8%C7%D1-%C7%E1%E3%E6%C8%C7%ED%E1-%E6%C7%E1%CA%DF%E4%E6%E1%E6%CC%ED%C7-1.htm
how can i make it in arabic like this
http://www.arabmobile.mobi/sklans/cat-اخبار الموبايل والتكنولوجيا.htm

thanks

Offline twiter

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #471 on: September 22, 2014, 09:37:21 PM »
I have a huge problem my oldest website.,
I saw this problem on webmaster tools and it gives me over 2000 not found page error.
One of them is :
http://www.citypictures.org/r-europe-148-spain-228-alcazar-castle-segovia-spain2844.htmttp://www.citypictures.org/postcard.img4343.htm


If you look carefull you can see end of the link problem.
When I click on the webmaster tools link which url gives this url
it shows me this page

http://www.citypictures.org/r-europe-148-spain-228-alcazar-castle-segovia-spain2844.htmttp://www.citypictures.org/r-middle-mast-149-united-arab-emirates-172-dubai-14-dubai-skyscrapers2-4343.htm

i click on this url and it seems a page like without css.


My . htaccess file is:


RewriteEngine On
RewriteRule 
^lightbox\.htmlightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htmlightbox.php?page=$1&%{QUERY_STRING}
RewriteRule ^search\.htmsearch.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htmsearch.php?page=$1&%{QUERY_STRING}
RewriteRule ^postcard([a-zA-Z0-9]+)\.htmpostcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htmpostcards.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^k-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^r-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^r([0-9]+).search.htm details.php?image_id=$1&%{QUERY_STRING}

I cant fix this.
Please help me asap.
Thank you.

Offline twiter

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #472 on: September 24, 2014, 10:54:38 AM »
77 views and no reply?
Is there any mods in here?

Offline Szooguun

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #473 on: June 15, 2015, 02:04:46 PM »
How to make a 301 redirect in .htaccess old addresses to the new?

example:
old: /categories.php?cat_id=1
new: /cat-test-1.htm

old: /details.php?image_id=1
new: /img-test-1.htm

Please help.


I was able to do so far "incomplete" 301 redirect in PHP. The file categories.php added at the beginning:

if (strpos($_SERVER['REQUEST_URI'], 'cat_id') !== FALSE) { 
header('HTTP/1.1 301 Moved Permanently');
header('Location: cat-'.$_GET['cat_name'].'-'.$_GET['cat_id'].'.htm');
exit;
}


But I do not know how to download the MYSQL database category name ['cat_name'] - Help
« Last Edit: June 16, 2015, 01:47:35 PM by Szooguun »

Offline wflorian

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #474 on: July 10, 2015, 03:23:30 PM »
Hello folks!

The SEO friendly URLs are great, but I discovered a majored bug, which can lead to NON-Google friendly behaviour because of so called duplicate content!  :!:

Fore example, a category with the following URL:

http://www.somename.com/cat-test-2.htm

-----

Can also be opened like this:

http://www.somename.com/cat-test8472874234dgdfjgdhkjghdkghf-2.htm

or like this:

http://www.somename.com/cat-different-1.html/cat-test-2.htm
(this one even makes all other internal links on the website uncorrect, because of realtive internal linking)

-----

Both URLs DO NOT lead to a 404, which is critically because Google can index those URLs, and this generates duplicate content, harming the rankings for the actual URL.

Is anybody aware of this bug?
Does anybody has an idea of a bugfix?

Really looking forward to some discussion because of this.....

Thanks!!

Best,
Florian

Offline FairyCosmo

  • Pre-Newbie
  • Posts: 9
  • ...for the lulz
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #475 on: December 19, 2015, 09:02:57 PM »
Don't even try it. This Mod is dead.. Like the whole community  :evil:

Offline IndoX

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #476 on: January 01, 2016, 07:55:19 PM »
As of 1.7.13 this mod is no longer working.

Offline Szooguun

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
« Reply #477 on: October 24, 2018, 11:06:21 PM »
Hi. Has anyone modified this mod and it works correctly on version 1.7.13? I would like to change the links to SEO Friendly however this mod contains many bugs.