PDA

Zobacz pełną wersję : Problem z przekierowaniem



damian14180
19-03-2013, 13:20
Witam.

Mam problem z przekierowaniem podstrony starej na nową podstronę. Otóż migrowałem na joomle 2.5 i zmienił się adres linków ( było to niecałe 2 miesiące temu).

Fraza "Suzuki Bandit 600" dalej pokazuje się w google jako stary link i przekierowuje na stronę główną a nie do nowej podstrony.

Stary podstrona: http://www.motocyklizm.pl/motocykle-katalog/suzuki/192-suzuki-bandit-600.html

Nowa podstrona: http://www.motocyklizm.pl/maszyny/motocykle/suzuki/item/192-suzuki-bandit-600

Próbowałem zrobić to w kompenencie przekierowania. Wkleiłem stary link podstrony i przekierowałem na link nowej podstrony ale to nie działa.

W pliku .htaccess wkleiłem

taką regułkę po RewriteEngine On

RewriteRule ^http://www.motocyklizm.pl/motocykle-katalog/suzuki/192-suzuki-bandit-600.html$ http://www.motocyklizm.pl/maszyny/motocykle/suzuki/item/192-suzuki-bandit-600 [R=301,L]

Ten sposób także nie działa. Nie wiem jak to rozwiązać. Strona jest duża, ma dużo podstron a w google frazy przekierowują na stronę główną zamiast do nowej podstrony. W google webmaster ciągle rosną mi błędy, w kompenencie przekierowania także.

Proszę o pomoc

Pozdrawiam

souacz
19-03-2013, 20:47
RewriteCond %{HTTP_HOST} ^motocyklizm.pl/motocykle-katalog/suzuki/192-suzuki-bandit-600.html(.*) [NC]
RewriteRule ^(.*)$ http://www.motocyklizm.pl/maszyny/motocykle/suzuki/item/192-suzuki-bandit-600 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.motocyklizm.pl/motocykle-katalog/suzuki/192-suzuki-bandit-600.html(.*) [NC]
RewriteRule ^(.*)$ http://www.motocyklizm.pl/maszyny/motocykle/suzuki/item/192-suzuki-bandit-600 [R=301,L]

Tylko nie wiem czy google nie karze za takie coś i nie wiem czy zadziała z google

damian14180
19-03-2013, 21:21
Nie pomogło

Tak wygląda mój htaccess


RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a ********** tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
RewriteCond %{HTTP_HOST} ^motocyklizm.pl/motocykle-katalog/suzuki/192-suzuki-bandit-600.html(.*) [NC]
RewriteRule ^(.*)$ http://www.motocyklizm.pl/maszyny/motocykle/suzuki/item/192-suzuki-bandit-600 [R=301,L]
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#


## End - Custom redirects

##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

RewriteBase /






## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.

souacz
19-03-2013, 21:39
Pisałem, że nie wiem czy to zadziała z google.
Poza tym jedno pytanie: obsługę htaccess masz oczywiście włączoną w konfiguracji?
Pytam bo różnie na forum bywa...

Nowa mapa strony wygenerowana i wysłana do webmasters?

damian14180
19-03-2013, 21:58
Tak mam włączoną obsługę Mod Rewrite

Mapę strony mam Xmap od początku i wysłana została do google webmaster. Zrobię jeszcze aktualizację ale nie wiem czy coś to pomoże. Myślałem że po okresie tych 2 miesięcy stare linki wygasną albo będą przekierowały na nowe adresy podstron. Ale wszystkie stare linki kierują na stronę główną.

souacz
19-03-2013, 22:13
przekierowanie wewnętrzne, przykład:

chcemy używać zamiast adresu "http://www.forum.opt...hp?showforum=9" (http://www.forum.optymalizacja.com/index.php?showforum=9) adresu "http://www.forum.opt...a.com/dowcipy/" (http://www.forum.optymalizacja.com/dowcipy/)

^/dowcipy/?$ /index.php?showforum=9[L,NC]

http://www.forum.optymalizacja.com/topic/62516-faq-htaccess-301-i-inne-seo-porady/ - druga wypowiedź


# zwróć uwagę na to, że adres przekierowania jest bez pełnego URLa oraz bez przekierowania 301 (jest to przekierowanie wewnętrzne serwera, niewidocznie dla przeglądarki internetowej)
RewriteRule ^([0-9])\/([^.]+)\.html$ /index.php?strona=$1
# pod $2 jest opis, można użyć też takiej konstrukcji
# RewriteRule ^([0-9])\/([^.]+)\.html$ /index.php?strona=$1&opis=$2