Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Przekierowania htacess
trifek
post 2.04.2019, 12:17:46
Post #1





Grupa: Zarejestrowani
Postów: 340
Pomógł: 0
Dołączył: 28.09.2015

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


Witam.
Mam taki .htaccess:
  1.  
  2. Options +FollowSymLinks
  3. RewriteEngine on
  4. RewriteRule cache/ - [F]
  5. Options -Indexes
  6.  
  7. RewriteCond %{HTTP_HOST} ^www.domains.eu [NC]
  8. RewriteRule ^(.*)$ <a href="https://domains.eu/$1" target="_blank">https://domains.eu/$1</a> [L,R=301]
  9.  
  10. RewriteCond %{REQUEST_FILENAME} !-f
  11. RewriteCond %{REQUEST_FILENAME} !-d
  12. RewriteCond %{REQUEST_FILENAME} !-l
  13. RewriteRule ^([a-zA-Z0-9\-\_\/]*)$ index.php?p=$1
  14.  
  15.  
  16. # Blokada hotlinking czyli kradzieży obrazków
  17. RewriteCond %{HTTP_REFERER} !^https://(.+\.)?domains.pl/ [NC]
  18. RewriteCond %{HTTP_REFERER} !^$
  19. RewriteCond %{HTTP_REFERER} !google\. [NC]
  20. RewriteCond %{HTTP_REFERER} !yahoo\. [NC]
  21. #RewriteRule .*\.(jpe?g|jpg|gif|bmp|png|jpeg)$ - [F]
  22.  
  23. #AuthType Basic
  24. #AuthName "Password Protected Area"
  25. #AuthUserFile /home/webplay/domains/domains.eu/public_html/.htpasswd
  26. #Require valid-user
  27.  
  28.  
  29.  
  30. # Prevent viewing of htaccess file.
  31. <Files .htaccess>
  32. order allow,deny
  33. deny from all
  34. </Files>
  35. RedirectMatch 403 ^.*/apps/(.*).php(.*)$
  36.  
  37. <ifModule mod_gzip.c>
  38. mod_gzip_on Yes
  39. mod_gzip_dechunk Yes
  40. mod_gzip_item_include file .(html?|txt|css|js|php|pl|map)$
  41. mod_gzip_item_include handler ^cgi-script$
  42. mod_gzip_item_include mime ^text/.*
  43. mod_gzip_item_include mime ^application/x-javascript.*
  44. mod_gzip_item_exclude mime ^image/.*
  45. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  46. </ifModule>



Potrzebuję następujące przekierowania:


- przekierowanie z http ://domains .pl, http ://www.domains .pl, https ://www.domains .pl, https ://domains .pl do https ://domains .eu

- przekierowanie z https ://www.domains .eu, http ://www.domains .pl, http ://domains .eu, do https ://domains .eu


W jaki sposób zrobić to w .htaccess ?

Ok, poradziłem sobie.

Rozwiązanie:

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://domain.eu/$1 [L,R=301]
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 05:31