Najnovšie módy
Najnovšie vzhľady
Anketa
Pri výbere hostingu...







Musíte byť prihlásený, aby ste mohli hlasovať.
SEO pre stránky
1. otvor subor root/maincore.php
NAJDI:
Code
ob_start();



NAHRAD:
Code
function rewrite_urls($buf) {
if(!substr_count($_SERVER['REQUEST_URI'],"administration"))
{
$buf = preg_replace('#readarticle\.php\?article_id=([0-9]*?)(\'|")#si', 'citaj-clanok\1.html\2', $buf);
$buf = preg_replace('#articles\.php\?cat_id=([0-9]*?)(\'|")#si', 'clanky_kategorie-\1.html\2', $buf);
$buf = preg_replace('#articles\.php#si', 'clanky.html', $buf);
$buf = preg_replace('#downloads\.php\?cat_id=([0-9]*?)(\'|")#si', 'downloads_cat\1.html\2', $buf);
$buf = preg_replace('#downloads\.php\?cat_id=([0-9]*?)(&|&)download_id=([0-9]*?)(\'|")#si', 'downloads\1-file-\3.html\4', $buf);
$buf = preg_replace('#downloads\.php#si', 'downloads.html', $buf);
$buf = preg_replace('#faq\.php\?cat_id=([0-9]*?)(\'|")#si', 'faq\1.html\2', $buf);
$buf = preg_replace('#faq\.php#si', 'faq.html', $buf);
$buf = preg_replace('#weblinks\.php\?cat_id=([0-9]*?)(\'|")#si', 'links_cat\1.html\2', $buf);
$buf = preg_replace('#weblinks\.php\?cat_id=([0-9]*?)(&|&)weblink_id=([0-9]*?)(\'|")#si', 'links_cat\1-linkid-\3.html\4', $buf);
$buf = preg_replace('#weblinks\.php#si', 'links.html', $buf);
$buf = preg_replace('#news_cats\.php\?cat_id=([0-9]*?)(\'|")#si', 'novinky_kategorie-\1.html\2', $buf);
$buf = preg_replace('#news\.php#si', 'novinky.html', $buf);
$buf = preg_replace('#news\.php\?readmore=([0-9]*?)(\'|")#si', 'citaj-novinku-\1.html\2', $buf);
$buf = preg_replace('#contact\.php#si', 'kontakt.html', $buf);
$buf = preg_replace('#photogallery\.php\?album_id=([0-9]*?)(\'|")#si', 'gallery-album\1.html\2', $buf);
$buf = preg_replace('#photogallery\.php\?photo_id=([0-9]*?)(\'|")#si', 'gallery-photo\1.html\2', $buf);
$buf = preg_replace('#showphoto\.php\?photo_id=([0-9]*?)(\'|")#si', 'showphoto\1.html\2', $buf);
$buf = preg_replace('#photogallery\.php#si', 'gallery.html', $buf);
$buf = preg_replace('#search\.php\?stype=f#si', 'hladat-f.html', $buf);
$buf = preg_replace('#search\.php#si', 'hladat.html', $buf);
$buf = preg_replace('#profile\.php\?lookup=([0-9]*?)(\'|")#si', 'pouzivatel-\1.html\2', $buf);
$buf = preg_replace('#print\.php\?type=N(&|&)item_id=([0-9]*?)(\'|")#si', 'print_news\2.html\3', $buf);
$buf = preg_replace('#print\.php\?type=A(&|&)item_id=([0-9]*?)(\'|")#si', 'rint_article\2.html\3', $buf);
$buf = preg_replace('#register\.php#si', 'register.html', $buf);
$buf = preg_replace('#lostpassword\.php#si', 'lostpass.html', $buf);
$buf = preg_replace('#viewpage\.php\?page_id=([0-9]*?)(\'|")#si', 'viewpage\1.html\2', $buf);
}
return $buf;
}
// Start Output Buffering
ob_start("rewrite_urls");



2. otvor subor root/themes/templates/footer.php\

NAJDI:
Code
echo handle_output($output);



NAHRAD:
Code
echo rewrite_urls(handle_output($output));



3. VYTVOR SUBOR: .htaccess

DONHO VLOZ:
Code
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(.*)$
RewriteRule ^clanky\.html$ articles.php [N]
RewriteRule ^clanky_kategorie-([0-9]+)\.html$ articles.php?cat_id=$1 [L]
RewriteRule ^citaj-clanok([0-9]+)\.html$ readarticle.php?article_id=$1 [L]
RewriteRule ^index\.html$ index.php [N]
RewriteRule ^downloads\.html$ downloads.php [N]
RewriteRule ^faq\.html$ faq.php [N]
RewriteRule ^links\.html$ weblinks.php [N]
RewriteRule ^novinky_kategorie\.html$ news_cats.php [N]
RewriteRule ^novinky_kategorie-([0-9]+)\.html$ news_cats.php?cat_id=$1 [L]
RewriteRule ^novinky\.html$ news.php [N]
RewriteRule ^citaj-novinku-([0-9]+)\.html$ news.php?readmore=$1 [L]
RewriteRule ^kontakt\.html$ contact.php [N]
RewriteRule ^gallery\.html$ photogallery.php [N]
RewriteRule ^hladat-f\.html$ search.php?stype=f [N]
RewriteRule ^hladat\.html$ search.php [N]
RewriteRule ^pouzivatel-([0-9]+)\.html$ profile.php?lookup=$1 [L]
RewriteRule ^gallery-album([0-9]+)\.html$ photogallery.php?album_id=$1 [L]
RewriteRule ^gallery-photo([0-9]+)\.html$ photogallery.php?photo_id=$1 [L]
RewriteRule ^showphoto([0-9]+)\.html$ showphoto.php?photo_id=$1 [L]
RewriteRule ^downloads_cat([0-9]+)\.html$ downloads.php?cat_id=$1 [L]
RewriteRule ^downloads_cat([0-9]+)-file([0-9]+)\.html$ downloads.php?cat_id=$1&download_id=$2 [L]
RewriteRule ^faq_cat([0-9]+)\.html$ faq.php?cat_id=$1 [L]\r\nRewriteRule ^links_cat([0-9]+)\.html$ weblinks.php?cat_id=$1 [L]
RewriteRule ^links_cat([0-9]+)-linkid-([0-9]+)\.html$ weblinks.php?cat_id=$1&weblink_id=$2 [L]
RewriteRule ^print_news([0-9]+)\.html$ print.php?type=N&item_id=$1 [L]
RewriteRule ^print_article([0-9]+)\.html$ print.php?type=A&item_id=$1 [L]
RewriteRule ^register\.html$ register.php [N]
RewriteRule ^lostpassword\.html$ lostpassword.php [N]
RewriteRule ^viewpage([0-9]+)\.html$ viewpage.php?page_id=$1 [L]



4. Nahraj subory na FTP a .htaccess daj tam kde je maincore.php do rootu
Článok napísal člen iMack
Komentáre
#1 | 3011 dňa 08.10.2011 19:37:57
na cz podpore je to dlho ne?
#2 | 515 dňa 08.10.2011 20:58:29
Neviem ono to tu bolo dlho ale potom sa to zmazalo 1
#3 | 1694 dňa 08.10.2011 21:56:38
Díky, hodí se 1
#4 | 515 dňa 08.10.2011 22:08:54
Nie je zač 1 Len mi to kus trvalo vyhrabať zo zálohy a upraviť 1
#5 | 4149 dňa 11.10.2011 19:30:12
Čo to vlastne robí? A ten htaccess vy ste napísali len príponu a to windovs nezobere. Ja som zrobil htaccess.htacceess a všetko podľa návodu a nič sa nezmenilo.
#6 | 515 dňa 12.10.2011 15:42:45
19 Je to 100%-funnkčné 1 A načo ti to je na windovse? 19
#7 | 4149 dňa 13.10.2011 17:28:33
Mne keď to urobím správne, už som ten súbor pomenoval .htaccess tak mi písala táto chyba pri otvorení stránky: The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, nezverejňujem mail@gmail.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error
log.

Teda chyba 500 INTERNAL SERVER ERROR
#8 | 800 dňa 17.10.2011 14:08:32
Veľmi dôležité je či váš hosting povoľuje mod rewrite :-).
#9 | 7 dňa 04.11.2011 10:05:09
Je tam chyba v tom .htaccess...
#10 | 3958 dňa 05.11.2011 15:42:44
jj .htaccess je trocha chybne ale neni to vono toto SEO ako napad je to super tuto upravu pouzijem na uzivatelov, modu preco sa registrovat a pod. ale z napr, clankov je to omho lepsie generovat linky: clanok-nazov-id.html vyzaduje to upravu articles.php, news.php a upravu .htaccess . to iste spravim aj u kategorii, kategoria-name-id.html aj na forach forum-nazov_temy-id.html google to potom lepsie indexuje. Este dodam example .htaccess

Code
RewriteRule ^clanok-(.*)-([0-9]+)\.html$ articles.php?article_id=$2 [L]



pre sytach:
Code
clanok-hocico-id.html


Pridať komentár
Pre pridanie komentára musíte byť prihlásený.
Hodnotenia
Musíte byť zaregistrovaný, aby ste mohli hodnotiť.

Prosím prihláste, alebo sa zaregistrujte.

Zatial nikto neohodnotil tento príspevok.