Skocz do zawartości


Zdjęcie

IP.Gallery Optymalizacja SEO Galerii IPB


  • Zaloguj się, aby dodać odpowiedź
2 odpowiedzi w tym temacie

#1 makensis

makensis

    Naczelny

  • 5 036 postów

Napisano 29 11 2013 - 15:34

W tym artykule dowiesz się jak zoptymalizować moduł Galeria(IP.Gallery) odpłatnie dołączany do forów IPB. Do naszych działań posłuży najnowsza wersja IPB 3.4.6 oraz galeria: 5.0.5.

 

Wymagania:

  • IPB 3.3.3 i wyżej
  • mod rewrite - htaccess
  • 10 minut wolnego czasu :P

Uwagi:

  • jeśli twoje forum ma już inną formę przyjaznych linków(np. domyślne) zadbaj o ich przekierowania w .htaccess dając 301 dla starej formatki linków! W ten sposób przeniesiesz ruch ze starych adresów www i Page Rank.

Part 1: Przyjazne adresy www Galerii IPB (IP.Gallery)

Założenia:

  • maksymalne skrócenie adresu WWW i jego "spolszczenie"
  • przyjazne adresy stron

Domyślne rozwiązania forum IPB:

  • h ttp://name-forums.pl/gallery/
  • h ttp://name-forums.pl/gallery/category/1-members-albums-category/

  • h ttp://name-forums.pl/gallery/album/1-nazwa-albumu/

  • h ttp://name-forums.pl/gallery/image/1-nazwa-tematu/

  • h ttp://name-forums.pl/gallery/sizes/nazwa-obrazka/

  • h ttp://name-forums.pl/gallery/member/1-cybi/

     

Potencjalne słowa kluczowe mamy po angielsku oraz nietrudno tutaj zauważyć ścisłą hierarchię treści z podziałem na katalogi: /gallery/ /album/ /image/ i dopiero tytuł.

Proponowane ustawienia:

  • gallery/album => $2-album-zdjecia$1/
  • gallery/member => $2-modele-uzytkownika$1/$3
  • gallery/image/ =>$2-obrazki$1/$3
  • gallery/category/ => $2-zdjecia-modeli$1/$3
  • gallery/sizes/ => $2-zdjecie$1/$3
  • gallery/ => modele/

Rozwiązanie:

  • Przejdź do lokalizacji: /admin/applications_addon/ips/gallery/extensions i otwórz plik furlTemplates.php
  • Podmień domyślną zawartość:
    $_SEOTEMPLATES = array(
    						
    						'viewsizes' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))image=(.+?)(?:(?:&|&))size=(.+?)(&|$)/i', 'gallery/sizes/$1-#{__title__}/$2/$3' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/sizes/(\d+?)-(.+?)/(?:(.+?)(/|$))?#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'images' ),
    																								array( 'section'	, 'sizes' ),
    																								array( 'image'		, '$1' ),
    																								array( 'size'		, '$3' ),
    																							)
    																	) 
    										),
    						'viewimage' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))image=(.+?)(&|$)/i', 'gallery/image/$1-#{__title__}/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/image/(\d+?)-#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'image'		, '$1' )
    																							)
    																	) 
    										),
    
    						'slideshow' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))module=images(?:(?:&|&))section=slideshow(?:(?:&|&))type=(album|category)(?:(?:&|&))typeid=(.+?)(&|$)/i', 'gallery/slideshow/$1-$2/$3' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/slideshow/(album|category)-(\d+?)(/|$)#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'images' ),
    																								array( 'section'	, 'slideshow' ),
    																								array( 'type'		, '$1' ),
    																								array( 'typeid'		, '$2' )
    																							)
    																	) 
    										),
    										
    						'editalbum' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))albumedit=(.+?)(&|$)/i', 'gallery/album/$1-#{__title__}/edit/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/album/(\d+?)-(.+?)/edit(/|$)#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'images' ),
    																								array( 'section'	, 'review' ),
    																								array( 'album_id'	, '$1' )
    																							)
    																	) 
    										),
    														
    						'viewalbum' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))(?:module=user(?:&|&)user=\d+?(?:&|&)do=view_album(?:&|&))?album=(.+?)(&|$)/i', 'gallery/album/$1-#{__title__}/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/album/(\d+?)-#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'album'		, '$1' )
    																							)
    																	) 
    										),
    
    						'viewcategory' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 0,
    											'out'			=> array( '/app=gallery(?:&|&)category=(\d+?)(&|$)/i', 'gallery/category/$1-#{__title__}/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/category/(\d+?)-#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'category'	, '$1' )
    																							)
    																	)
    										),
    
    						'galleryrss' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))module=albums(?:(?:&|&))section=rss(?:(?:&|&))type=(album|category)(?:(?:&|&))typeid=(\d+?)(&|$)/i', 'gallery/rssfeed/#{__title__}/$1-$2/$3' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/rssfeed/(.+?)/(album|category)-(\d+?)(/|$)#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'albums' ),
    																								array( 'section'	, 'rss' ),
    																								array( 'type'		, '$2' ),
    																								array( 'typeid'		, '$3' )
    																							)
    																	) 
    										),
    										
    						'useralbum' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))user=(.+?)(&|$)/i', 'gallery/member/$1-#{__title__}/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/member/(\d+?)-#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'albums' ),
    																								array( 'section'	, 'user' ),
    																								array( 'member_id'	, '$1' )
    																							)
    																	) 
    										),
    						
    						'app=gallery'		=> array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery/i', 'gallery/' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery(/|$|\?)#i',
    																		'matches'	=> array( array( 'app', 'gallery' ) )
    																	) 
    														),
    					);
    
    Na:
    // Edited by Makensis (www.tweaks.pl) ver 0.9
    $_SEOTEMPLATES = array(
    						
    						'viewsizes' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))image=(.+?)(?:(?:&|&))size=(.+?)(&|$)/i', '#{__title__}-zdjecie$1/$2/$3' ),
    											'in'			=> array( 
    																		'regex'		=> '#-zdjecie(\d+?)\/(?:(.+?)(/|$))?#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'images' ),
    																								array( 'section'	, 'sizes' ),
    																								array( 'image'		, '$1' ),
    																								array( 'size'		, '$3' ),
    																							)
    																	) 
    										),
    					
    
    
    
    
    
    					'viewimage' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))image=(.+?)(&|$)/i', '#{__title__}-obrazki$1/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#-obrazki(\d+?)\/#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'image'		, '$1' )
    																							)
    																	) 
    										),
    
    						'slideshow' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))module=images(?:(?:&|&))section=slideshow(?:(?:&|&))type=(album|category)(?:(?:&|&))typeid=(.+?)(&|$)/i', 'gallery/slideshow/$1-$2/$3' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/slideshow/(album|category)-(\d+?)(/|$)#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'images' ),
    																								array( 'section'	, 'slideshow' ),
    																								array( 'type'		, '$1' ),
    																								array( 'typeid'		, '$2' )
    																							)
    																	) 
    										),
    										
    						'editalbum' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))albumedit=(.+?)(&|$)/i', '#{__title__}-zdjeeecia-modele$1/edit/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#-zdjeeecia-modele(\d+?)\/edit(/|$)#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'images' ),
    																								array( 'section'	, 'review' ),
    																								array( 'album_id'	, '$1' )
    																							)
    																	) 
    										),
    														
    						'viewalbum' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))(?:module=user(?:&|&)user=\d+?(?:&|&)do=view_album(?:&|&))?album=(.+?)(&|$)/i', '#{__title__}-album-zdjecia$1/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#-album-zdjecia(\d+?)\/#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'album'		, '$1' )
    																							)
    																	) 
    										),
    
    						'viewcategory' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 0,
    											'out'			=> array( '/app=gallery(?:&|&)category=(\d+?)(&|$)/i', '#{__title__}-zdjecia-modeli$1/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#-zdjecia-modeli(\d+?)\/#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'category'	, '$1' )
    																							)
    																	)
    										),
    
    						'galleryrss' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))module=albums(?:(?:&|&))section=rss(?:(?:&|&))type=(album|category)(?:(?:&|&))typeid=(\d+?)(&|$)/i', 'gallery/rssfeed/#{__title__}/$1-$2/$3' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/gallery/rssfeed/(.+?)/(album|category)-(\d+?)(/|$)#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'albums' ),
    																								array( 'section'	, 'rss' ),
    																								array( 'type'		, '$2' ),
    																								array( 'typeid'		, '$3' )
    																							)
    																	) 
    										),
    										
    						'useralbum' => array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery(?:(?:&|&))user=(.+?)(&|$)/i', '#{__title__}-modele-uzytkownika$1/$2' ),
    											'in'			=> array( 
    																		'regex'		=> '#-modele-uzytkownika(\d+?)\/#i',
    																		'matches'	=> array( 
    																								array( 'app'		, 'gallery' ),
    																								array( 'module'		, 'albums' ),
    																								array( 'section'	, 'user' ),
    																								array( 'member_id'	, '$1' )
    																							)
    																	) 
    										),
    						
    						'app=gallery'		=> array( 
    											'app'			=> 'gallery',
    											'allowRedirect' => 1,
    											'out'			=> array( '/app=gallery/i', 'modele/' ),
    											'in'			=> array( 
    																		'regex'		=> '#^/modele(/|$|\?)#i',
    																		'matches'	=> array( array( 'app', 'gallery' ) )
    																	) 
    														),
    					);
    
  • Zapisz zmiany w pliku i prześlij plik na serwer
  • Zaloguj się do Panelu Administratora i wybierz: Zarządzanie pamięcią podręczną, a następnie: Przebuduj pamięć podręczną FURL (komunikat o potrzebie odświeżenia pamięci cache powinien się pojawić na stronie głównej panelu administracyjnego)
  • Aby nie utracić cennego ruchu z wyszukiwarek. Dodaj odpowiedni wpis o przekierowaniach w pliku konfiguracyjnym serwera Apache. W tym celu otwórz plik .htaccess w lokalizacji głównego folderu twojego forum
  • Dodaj polecenia:
    [hide]

    RewriteRule ^/gallery/album/([0-9]*)-([^/]*)/(.*) $2-album-zdjecia$1/ [R=301,L]
    RewriteRule gallery/member/([0-9]*)-([^/]*)/(.*) $2-modele-uzytkownika$1/$3 [R=301,L]
    RewriteRule gallery/image/([0-9]*)-([^/]*)/(.*) $2-obrazki$1/$3 [R=301,L]
    RewriteRule gallery/category/([0-9]*)-([^/]*)/(.*) $2-zdjecia-modeli$1/$3 [R=301,L]
    RewriteRule gallery/sizes/([0-9]*)-([^/]*)/(.*) $2-zdjecie$1/$3 [R=301,L]
    RewriteRule ^gallery/ modele/ [R=301,L]

    [/hide]

  • Zapisz zmiany i prześlij plik ponownie na serwer



  • 0

#2 makensis

makensis

    Naczelny

  • 5 036 postów

Napisano 29 11 2013 - 16:15

part 2. Optymalizacja templatki Galerii IPB

  • Wybierz "category" w "skin_gallery_home", w twojej domyślnej skórce forum
  • Znajdź bit:
    <h1 class='ipsType_pagetitle'>{$category['category_name']}</h1>
     i zamień na:
    <h1 class='ipsType_pagetitle'>{$category['category_name']} zdjęcia</h1>
  • Wybierz "show_image" w "skin_gallery_img", w twojej domyślnej skórce forum
  • Znajdź bit:
    <h1 class='ipsType_pagetitle'>{$info['image_caption']}</h1>
     i zamień na:
    <h1 class='ipsType_pagetitle'>{$info['image_caption']} zdjęcia</h1>


  • 0

#3 makensis

makensis

    Naczelny

  • 5 036 postów

Napisano 01 01 2015 - 19:23

Przyjazne adresy www Galerii IPB (IP.Gallery) zgodne z IPB 3.4.7 i Gallery  v5.0.5



  • 0

Zobacz więcej tematów z tagiem: IPB ip.gallery SEO



Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych