Jump to content
php.lv forumi

Atverot lapu jāatver intro lapa


senters

Recommended Posts

Kā bez htaccess redirektiem panākt, lai ierakstot www.lapa.lv atvertos www.lapa.lv/intro/

 

man bija šādi, bet tas googles seo nemaz nepatīk, bļauj par 302 not followed erroriem

 

 

if (empty($_SESSION['visited']) || $_SESSION['visited'] < 3) {
header('Location: http://www.lapa.lv/intro/');
$_SESSION['visited'] = empty($_SESSION['visited']) ? 1 : $_SESSION['visited'] + 1;
}

Link to comment
Share on other sites

Es izmantotu index.html, kur būtu

 

Meta refresh + JavaScript (varbūt) redirekts ,bet ja gribi ar PHP, tad es darītu šādi:

 

<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.lapa.lv/intro/'); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
?>

Edited by blackhalt
Link to comment
Share on other sites

Liec visu www.lapa.lv/ nevis www.lapa.lv/intro/

Es īsti nesaprotu kāda jēga no tā, ka saturs tiek ielikts kaut kādā apakšdirektorijā.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...