Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Przekierowanie 301
spock
post
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 23.01.2017

Ostrzeżenie: (0%)
-----


Witam,

Mam pytanie, czy da się wykonać przekierowanie 301 z domena1.eu na domena1.pl, ale tak aby zachować przyjazne linki.

Przykład:

przekierowanie 301 z dmena1.eu na domena1.pl w przypadku linku /blog daje następujący efekt:

domena1.pl/blog ---> domena1.pl/index.php/?pages=blog, jak zrobić aby było domena1.pl/blog ? oczywiście oby dwie strony są takie same, mają porobione reguły zmiany na przyjazne linki, ale piszę przy przekierowaniu zmienia link z powrotem.

Ktoś? coś ?

Go to the top of the page
+Quote Post
trueblue
post
Post #2





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


Przekierowanie domena1.eu na domena1.pl daje: domena1.pl/blog ---> domena1.pl/index.php/?pages=blog?
Pokaż jak wykonujesz to przekierowanie.
Go to the top of the page
+Quote Post
spock
post
Post #3





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 23.01.2017

Ostrzeżenie: (0%)
-----


RewriteCond %{HTTP_HOST} ^www.domena.eu(.*) [NC]
RewriteRule ^(.*)$ http://www.domena.pl/$1 [R=301,L]

domena.eu/blog daje domena.pl/index.php/?pages=blog a chce efekt osiągnąc taki:

domena.eu/blog daje domena.pl/blog

Ten post edytował spock 2.02.2017, 17:05:52
Go to the top of the page
+Quote Post
trueblue
post
Post #4





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


W warunku $ zamiast (.*)
Ale to powinno działać bez problemu.
To cały .htaccess?
Go to the top of the page
+Quote Post
spock
post
Post #5





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 23.01.2017

Ostrzeżenie: (0%)
-----


Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# except for form POSTS
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
RewriteCond %{HTTP_HOST} ^www.domena.eu(.*) [NC]
RewriteRule ^(.*)$ http://www.domena.pl/$1 [R=301,L]

jakieś pomysły ?

Przypomne że w domenie domena.pl htacces wyglada tak samo, oczywiście bez 301,

Ten post edytował spock 2.02.2017, 20:02:34
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 18.09.2025 - 01:18