Bonjour,
j'ai commencé à passer mon site en https chez infomaniak, je suis occupé à changer mes urls absolues en relatives, j'ai aussi réfléchi à l'url rewriting mais je suis loin d'être un spécialiste et j'ai besoin de votre avis.
actuellement j'ai :
Et je compte passer à :
Merci de me dire ce que vous en pensez ?
j'ai commencé à passer mon site en https chez infomaniak, je suis occupé à changer mes urls absolues en relatives, j'ai aussi réfléchi à l'url rewriting mais je suis loin d'être un spécialiste et j'ai besoin de votre avis.
actuellement j'ai :
Code:
################################## Errors ######################################
#ErrorDocument 301 /error/301-moved_permanently.html
#ErrorDocument 302 /error/302-moved_temporarily.html
#ErrorDocument 303 /error/303-see_other.html
#ErrorDocument 400 /error/400-bad_request.html
ErrorDocument 401 /error/401-authorization_required.html
#ErrorDocument 402 /error/402-payment_required.html
ErrorDocument 403 /error/403-forbidden.html
ErrorDocument 404 /erreur404.php
#ErrorDocument 405 /error/405-method_not_allowed.html
#ErrorDocument 406 /error/406-not_acceptable.html
#ErrorDocument 407 /error/407-proxy_authentication_required.html
ErrorDocument 408 /error/408-request_timed_out.html
#ErrorDocument 409 /error/409-conflicting_request.html
#ErrorDocument 410 /error/410-gone.html
#ErrorDocument 411 /error/411-content_length_required.html
#ErrorDocument 412 /error/412-precondition_failed.html
#ErrorDocument 413 /error/413-request_entity_too_long.html
#ErrorDocument 414 /error/414-request_uri_too_long.html
#ErrorDocument 415 /error/415-unsupported_media_type.html
ErrorDocument 500 /error/500-internal_server_error.html
#ErrorDocument 501 /error/501-not_implemented.html
#ErrorDocument 502 /error/502-bad_gateway.html
ErrorDocument 503 /error/503-service_unavailable.html
#ErrorDocument 504 /error/504-gateway_timeout.html
#ErrorDocument 505 /error/505-http_version_not_supported.html
################################################################################
######################### Howto map /~user to /user ############################
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/([^/]+)$
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^([^/]+)$ http://%{HTTP_HOST}/$1/ [R,L]
RewriteCond %{REQUEST_URI} ^/([^/]+)/
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^([^/]+)(.+)$ /~$1/$2
################################################################################
###################### Howto map /users/user to /users/user ####################
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/users/([^/]+)$
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^users/([^/]+)$ http://%{HTTP_HOST}/users/$1/ [R,L]
RewriteCond %{REQUEST_URI} ^/users/([^/]+)/
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^users/([^/]+)(.+)$ /~$1/$2
################################################################################
RewriteCond %{HTTP_HOST} !monsite.be
RewriteRule (.*) http://www.monsite.be/$1 [R=301]
RewriteCond %{HTTP_HOST} ^monsite.be$
RewriteRule ^(.*) http://www.monsite.be/$1 [QSA,L,R=301]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{REQUEST_URI} !(banniere2.jpg|aa.gif)
RewriteCond %{http_REFERER} !(http://www.monsite.be/|http://www.siteB.be/|http://www.siteC.be/|http://www.siteD.com/|http://images.google.be/|http://images.google.com/|http://images.google.fr/|http://images.google.ca/)
RewriteCond %{HTTP_REFERER} !^http://www.monsite.be/.*$ [NC]
RewriteRule .*\.(gif|png|JPG|jpe?g)$ - [F]
Et je compte passer à :
Code:
################################## Errors ######################################
#ErrorDocument 301 /error/301-moved_permanently.html
#ErrorDocument 302 /error/302-moved_temporarily.html
#ErrorDocument 303 /error/303-see_other.html
#ErrorDocument 400 /error/400-bad_request.html
ErrorDocument 401 /error/401-authorization_required.html
#ErrorDocument 402 /error/402-payment_required.html
ErrorDocument 403 /error/403-forbidden.html
ErrorDocument 404 /erreur404.php
#ErrorDocument 405 /error/405-method_not_allowed.html
#ErrorDocument 406 /error/406-not_acceptable.html
#ErrorDocument 407 /error/407-proxy_authentication_required.html
ErrorDocument 408 /error/408-request_timed_out.html
#ErrorDocument 409 /error/409-conflicting_request.html
#ErrorDocument 410 /error/410-gone.html
#ErrorDocument 411 /error/411-content_length_required.html
#ErrorDocument 412 /error/412-precondition_failed.html
#ErrorDocument 413 /error/413-request_entity_too_long.html
#ErrorDocument 414 /error/414-request_uri_too_long.html
#ErrorDocument 415 /error/415-unsupported_media_type.html
ErrorDocument 500 /error/500-internal_server_error.html
#ErrorDocument 501 /error/501-not_implemented.html
#ErrorDocument 502 /error/502-bad_gateway.html
ErrorDocument 503 /error/503-service_unavailable.html
#ErrorDocument 504 /error/504-gateway_timeout.html
#ErrorDocument 505 /error/505-http_version_not_supported.html
################################################################################
######################### Howto map /~user to /user ############################
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/([^/]+)$
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^([^/]+)$ https://%{HTTP_HOST}/$1/ [R,L] (ligne modifiée http remplacé par https)
RewriteCond %{REQUEST_URI} ^/([^/]+)/
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^([^/]+)(.+)$ /~$1/$2
################################################################################
###################### Howto map /users/user to /users/user ####################
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/users/([^/]+)$
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^users/([^/]+)$ https://%{HTTP_HOST}/users/$1/ [R,L] (ligne modifiée http remplacé par https)
RewriteCond %{REQUEST_URI} ^/users/([^/]+)/
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d
RewriteRule ^users/([^/]+)(.+)$ /~$1/$2
################################################################################
RewriteEngine on (conseillé par infomaniak)
RewriteCond %{HTTP:X-Forwarded-Proto} !https (conseillé par infomaniak)
RewriteRule (.*) https://www.monsite.be/$1 [R=301,L] (conseillé par infomaniak www ou pas ?)
RewriteCond %{HTTP_HOST} !monsite.be
RewriteRule (.*) https://monsite.be/$1 [R=301] (ligne modifiée http remplacé par https)
RewriteCond %{HTTP_HOST} ^monsite.be$
RewriteRule ^(.*) https://monsite.be/$1 [QSA,L,R=301] (ligne modifiée http remplacé par https)
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{REQUEST_URI} !(banniere2.jpg|aa.gif)
RewriteCond %{http_REFERER} !(https://www.monsite.be/|https://www.siteb.be/|https://www.sitec.be/|https://www.sited.com/|https://images.google.be/|https://images.google.com/|https://images.google.fr/|https://images.google.ca/) (ligne modifiée http remplacé par https)
RewriteCond %{HTTP_REFERER} !^https://www.monsite.be/.*$ [NC] (ligne modifiée http remplacé par https)
RewriteRule .*\.(gif|png|JPG|jpe?g)$ - [F]
Merci de me dire ce que vous en pensez ?