redirect 301 godaddy

Zdravo,

Lepo bi Vas prosila za pomoč.

Imama domeno npr. www.hiša.si Zdaj bi to domeno preusmerila na www.hisa.si

V goddayju sem dala redirect root 301 iz hiša na hisa. Po dolgih 24h je stran zkončno začela funkcionirat vendar bere welcome.html (godaddy standardni) in sploh noče redirectat.

Kaj moram narest?

Kreirat .htaccess in php file? S tem supportom na godadiju nikamor ne pridem.

.htaccess imam trenutno takle..

RewriteEngine on
rewritecond %{http_host} xn--hisa-euc.si/ [nc]
rewriterule (.*)$ http://www.hisa.si/$1 [r=301,nc]

php pa takle

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.hisa.si/");
exit();
?>

Prosim za pomoč, ker mi nič ne dela.

31 odgovorov

Apache Mod-Rewrite modul mora biti omogočen.

RewriteEngine on
RewriteRule (.*) http://www.hisa.si/$1 [R=301,L]

Aljo:
Apache Mod-Rewrite modul mora biti omogočen.

RewriteEngine on
RewriteRule (.*) http://www.hisa.si/$1 [R=301,L]

ma nič mi ne dela :/

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator and inform them of the time the error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache Server at xn--hisa-euc.si Port 80

Zakomentiraj Options +FollowSymLinks

#Options +FollowSymLinks

Pa posreduj .htaccess fajl.

pa to jst ne znam - sm živi butl za programiranje :D jst si sam želim da je ta stran s šumniki
redirectana na isto domeno brez šumnika. ah, ko bi le delal 301 redirect.

na godaddy supportu so mi povedal da rabim dva fajla - en je .htaccess, drugi pa php fajl

php fajl naj bi se imenoval hiša.php (ali tista s wn.. sej ne vem)
koda pa nja bi bila takšna:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.hisa.si/");
exit();
?>

.htaccess pa tak:

RewriteEngine on
rewritecond %{http_host} xn--hisa-euc.si/ [nc]
rewriterule (.*)$ http://www.hisa.si/$1 [r=301,nc]


tole so njihova navodila:

PHP

Save this as oldpagename.php

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.com/newpage.html");
exit();
?>

.htaccess

When using a Linux server with the Apache Mod-Rewrite module enabled, you can create a .htaccess file to ensure that all requests to coolexample.com will redirect to www.coolexample.com, where "coolexample.com" is your domain. Save the .htaccess file in your old website's root directory, which is the same directory as your index file. You can create a .htaccess file with the following code:

RewriteEngine on
rewritecond %{http_host} coolexample.com [nc]
rewriterule (.*)$ http://www.coolexample.com/$1 [r=301,nc]


fora je v tem, da jaz nimam newpage.html ampak gre direktno na root folder

bila bi zelo hvaležna, če mi omagaš :) s temi stavki se ukvarjam že dva dni :D

Aljo? ti je uspelo pogledati kodo?

Vse kar rabiš je datoteka .htaccess v rootu na tvoji stari domeni, vsebina datoteke pa je lahko ena izmed teh štirih metod: http://301redirects.net/redirect-old-domain-to-new-website.php

Gizmo sem si izbrala metodo 1 - ne dela.

Php fajl sem zdaj izbrisala. Namesto domene s šumnikom sem dala xn..

Vse kar rabiš je .htaccess, nobenih PHP preusmeritev.
Tale oblika je pravilna:

RewriteEngine on
RewriteCond %{HTTPHOST} ^xn--hisa-euc.si [NC]
RewriteRule ^(.*)$ http://www.hisa.si/$1 [L,R=301]
RewriteCond %{HTTP
HOST} ^www.xn--hisa-euc.si [NC]
RewriteRule ^(.*)$ http://www.hisa.si/$1 [L,R=301]

Ne uporabljaj šumnikov v .htacessu. Verjetno si že naletela na rešitev, ampak se ti je brskalnik zapomnil prejšnje nastavitve. Vedno ko testiraš, odpri v incognito ali pa pobriši predpomnilnik brskalnika.

1

ma ne dela mi ..

1

Potem je pa kje drugje problem, ne v vsebini datoteke. Saj imaš ime datoteke natanko ".htaccess"? Preveri, če morda delujejo kakšni drugi ukazi ali redirecti v tej datoteki.