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

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

0 Members and 2 Guests are viewing this topic.

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #480 on: December 08, 2009, 04:16:43 AM »
Hi,
    I have been using this MOD for a long time.. I don't know how I made it at that time.. My urls are like this.. www.domainname.com/k-category-name-123.htm and detail page urls are like this .. www.domain.com/r-image-name-1234.htm. Its working fine... but now I have noticed that .. Google is trying to find my both the urls and marked them as duplicate content..


Could anyone please let me know how to stop detail.php?image_id=xxxx format urls ?? or is it possible to redirect all the detail.php to r-image-name-123.htm page with 301 code by updating the .htaccessf file ??

A small help will also be appreciated. ..


Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #481 on: December 11, 2009, 12:34:44 AM »
also, has anyone been able to solve the problem of the category drop-down form?

If I install this mod, my category drop-down no longer works :(
It just redirects to www.mysite.com/cat.htm
whatever option I choose on the dropdown

I searched through the 27 pages but didn't see a solution
have the same problem....  :|
And another one - if someone uses search or clicks on "new posts" - all the thumbnails have the links like "/img2139.search.htm" which is a duplicate for "/img2139.htm", and thats not good for search engines.... Can I have those links without the word "search" in them? :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 #482 on: December 11, 2009, 02:36:45 AM »
also, has anyone been able to solve the problem of the category drop-down form?

If I install this mod, my category drop-down no longer works :(
It just redirects to www.mysite.com/cat.htm
whatever option I choose on the dropdown

I searched through the 27 pages but didn't see a solution
have the same problem....  :|
I can't reproduce on my local server, everything works fine here, with the code from first page. Perhaps it's a server-related?

And another one - if someone uses search or clicks on "new posts" - all the thumbnails have the links like "/img2139.search.htm" which is a duplicate for "/img2139.htm", and thats not good for search engines.... Can I have those links without the word "search" in them? :roll:
This has been discussed here so many times...you'll need deny bots via robots.txt from accessing anything search related.


And to anyone asking questions regarding search engine bots: control what they can and can't access via robots.txt.
Search the web for more info.
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 k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #483 on: December 11, 2009, 02:14:38 PM »
also, has anyone been able to solve the problem of the category drop-down form?

If I install this mod, my category drop-down no longer works :(
It just redirects to www.mysite.com/cat.htm
whatever option I choose on the dropdown

I searched through the 27 pages but didn't see a solution
have the same problem....  :|
I can't reproduce on my local server, everything works fine here, with the code from first page. Perhaps it's a server-related?
I dunno, but I have had this small "bug" on all of 3 hosting servers I've moved on lately... And your local server, is it Windows or still Linux/*nix?  :roll:

And another one - if someone uses search or clicks on "new posts" - all the thumbnails have the links like "/img2139.search.htm" which is a duplicate for "/img2139.htm", and thats not good for search engines.... Can I have those links without the word "search" in them? :roll:
This has been discussed here so many times...you'll need deny bots via robots.txt from accessing anything search related.


And to anyone asking questions regarding search engine bots: control what they can and can't access via robots.txt.
Search the web for more info.
Thanks, Vano, yeah, I know about the possibility to bar SE bots from indexing some types of links on the site by means of "disallow" strings in robots.txt file.
But nonetheless I would still like to know if its possilbe to get rid of those "search" inclusions into the "img....htm" URLs, cause not only search engines dont like those thinhs, but me actually as wel  :) Those pages have no distinctions on them, and therefore are simple detail-pages with duplicated content and different URLs, so I cannot understand why that "search"-word should stay there  :|
Or maybe it has some original explanation and logical grounding?  :)


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 #484 on: December 11, 2009, 02:33:11 PM »
The "search" mode is needed for next/prev links at image details page. It has the same purpose as "lightbox" mode. By removing this it will probably affect your server's load because visitors will  most likely have to refresh the search results after viewing details of one image in order to see next image from that search (perform search, view one image, go back, search again, view next image, so on)

in search.php replace
    show_image($image_row"search");
with:
    show_image($image_row);
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 k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #485 on: December 11, 2009, 02:53:14 PM »
Thanks, V@no! Now I see why its needed, just didn't pay attention to the fact, that while visiting such pages (with that search-tag) we get next/prev search results but not photos from the same category as usual  :P

The "search" mode is needed for next/prev links at image details page. It has the same purpose as "lightbox" mode. By removing this it will probably affect your server's load because visitors will  most likely have to refresh the search results after viewing details of one image in order to see next image from that search (perform search, view one image, go back, search again, view next image, so on)

in search.php replace
    show_image($image_row"search");
with:
    show_image($image_row);



Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #486 on: December 18, 2009, 04:30:41 AM »
also, has anyone been able to solve the problem of the category drop-down form?

If I install this mod, my category drop-down no longer works :(
It just redirects to www.mysite.com/cat.htm
whatever option I choose on the dropdown

I searched through the 27 pages but didn't see a solution
have the same problem....  :|
I can't reproduce on my local server, everything works fine here, with the code from first page. Perhaps it's a server-related?
If I have "form method="post" in my category_dropdown_form.html - then after choosing any category from a dropdown-menu a person gets redirected right but gets the wrong address in URL (always just /cat.htm without any numbers).
 If I change it to "form method=get" - then I get redirected right as well, but get URLs like "/cat.htm?cat_id=68" instead of just "/cat68.htm"...

Is it possible to correct that issue plz? :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 #487 on: December 18, 2009, 06:36:23 AM »
That is how POST method works, it's not a bug and it's not a problem. Also, even though it shows cat.html in the url, it opens correct category.
Nothing you can do about it (unless you want play with javascript and on-fly change the form's action value).

[EDIT]
Here is javascript part that can be used for this matter:
In includes/functions.php find:
      $category "\n<select name=\"".URL_CAT_ID."\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['jumpbox'].submit() }\" class=\"categoryselect\">\n";

Replace it with:
      $category "\n<select name=\"".URL_CAT_ID."\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['jumpbox'].setAttribute('action',forms['jumpbox'].getAttribute('action').replace('cat\.','cat'+this.options[this.selectedIndex].value+'.'));this.disabled=true;forms['jumpbox'].submit();this.disabled=false; }\" class=\"categoryselect\">\n";
« Last Edit: December 18, 2009, 07:30:36 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 k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #488 on: December 18, 2009, 08:38:52 AM »
V@no, that worked out again!  :D
I already dunno how to thank you and requite your patience and assistance!  :o

I'm a bit impudent and importunate... but - maybe you may have an answer to this question?  :roll:
http://www.4homepages.de/forum/index.php?topic=7700.msg143631#msg143631  :oops:


Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #489 on: December 22, 2009, 07:22:44 AM »
After completing my upgrade from 1.7.4 to 1.7.7 (making changes in sessions.php in particular) I now notice that some URLs with sessionid=... at the end are starting to appear again for me, for some of my friends, and for search engine bots (google, yandex etc) ...  :|

I found in backed-up copies, that I previously had the following snippet of code in my includes/sessions.php:
Code: [Select]
   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;
    }

And right now I changed it to the following:
Code: [Select]
   if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= "l=".$l;
    }

May that be the reason?
And another question - if that was the reason, may I simply undo those changes without any harm to the script itself or causing its malfunctioning ?

Or maybe I should better try to implement the change, described by you here: http://www.4homepages.de/forum/index.php?topic=6729.msg59251#msg59251  :?:


« Last Edit: December 22, 2009, 10:29:32 AM by k1lljoy »


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 #490 on: December 22, 2009, 03:21:14 PM »
The second code is correct code.
Yes, you could try do the bot support code.
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 k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #491 on: December 22, 2009, 03:50:54 PM »
The second code is correct code.
Yes, you could try do the bot support code.
Thanx!
And the follow-up question:
If I have that second code in sessions.php (above-mentioned by me in the previous post) - and when I set in my browser to block all cookies - is that right, that the appearing sessionid changes each time I press F5 (i.e. reload the page) ?  :|  Cause my IP isn't changing, my session isn't as well I guess...  :?:


Offline V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #492 on: December 22, 2009, 09:22:08 PM »
yes, that is correct. 4images does't care at which ip the request came from. some isp work as proxy, and each refresh could come from different ip (i.e. everyone's favourite aol)
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #493 on: January 06, 2010, 06:07:28 AM »
Well, it looks like SE bots get sessionid on their first visit now and thus just stop crowling the site cause URLs with sessonid are prohibited to index through robots.txt rules  :|
And ppl start posting URLs with thier sessionid's sometimes...
And with the purpose to get rid of those vulnerabilities and disadvantages, and inconveniences for search engines' indexing I've decided to switch off the sessionid feature totally. Is that possible?  :roll:
 I clearly understand that some percentage of people after those changes would not be able to login or browse through search results... but lots of sites use just the cookie feature for authorization and other things, and they are doing quite well  :)




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 #494 on: January 06, 2010, 02:49:00 PM »
Just use the code, I believe provided somewhere in this topic, that would switch off sessionid for the bots only...If I recall correctly that code is based on "treat bots as members" mod or something like that..
Sorry, I don't have time at the moment to be more specific, but it's there ;)
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)