Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2502 connectés 

  FORUM HardWare.fr
  Réseaux grand public / SoHo
  Hébergement

  Sous-dossier qui transforme la racine de mon URL en subdomain [Résolu]

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Sous-dossier qui transforme la racine de mon URL en subdomain [Résolu]

n°1117610
User Name
Posté le 06-05-2020 à 15:33:12  profilanswer
 

Bonjour à tous,
 
Je possède un site web chez un hébergeur mutualisé où la racine contient un fichier index.html et trois sous-dossiers pour 3 sites (1 statique, 2 blogs wordpress).
Mes trois sous-domaines sitestatique.site.com, blog1.site.com et blog2.site.com redirigent vers les sous-dossiers respectifs.
 
Tout fonctionnait jusqu'à hier soir, où, sans manipulation particulière, mon blog2 s'est mis à remplacer la racine de son URL par blog2.site.com
Autrement dit, alors qu'un bouton de l'index est censé me rediriger vers monsite.com/blog2, il me redirige désormais vers blog2.site.com/blog2
 
Le blog1 et le site statique, eux, ne sont absolument pas affectés.
 
Pour résumer, si je tape :  
monsite.com => OK
monsite.com/blog1 => OK
blog1.monsite.com => monsite.com/blog1 (OK)
sitestatique.monsite.com => monsite.com/sitestatique (OK)
monsite.com/blog2 => blog2.site.com/blog2 (KO)
 
N'ayant rien fait de particulier, j'ai décidé de supprimer le sous-domaine de chez mon hébergeur, mais le problème persiste. On m'a dit d'attendre que les DNS soient rafraichis, mais cela fait plusieurs heures que c'est pareil.
Voici mes .htaccess
 
Racine

Code :
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3. RewriteCond %{HTTPS} !=on [OR]
  4. RewriteCond %{HTTP_HOST} ^http://www\.chartouni\.fr [NC]
  5. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
  6. </IfModule>


 
blog1

Code :
  1. # BEGIN WordPress
  2. # Les directives (lignes) entre 'BEGIN WordPress' et 'END WordPress' sont
  3. # généré dynamiquement, et ne doivent uniquement être modifiées via les filtres WordPress.
  4. # Toute modification des directives entre ces marqueurs sera outrepassée.
  5. <IfModule mod_rewrite.c>
  6. RewriteEngine On
  7. RewriteCond %{HTTPS} !=on [OR]
  8. RewriteCond %{HTTP_HOST} ^http://www\.chartouni\.fr/blog [NC]
  9. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
  10. RewriteBase /blog1/
  11. RewriteRule ^index\.php$ - [L]
  12. RewriteCond %{REQUEST_FILENAME} !-f
  13. RewriteCond %{REQUEST_FILENAME} !-d
  14. RewriteRule . /blog1/index.php [L]
  15. </IfModule>
  16. # END WordPress


 
blog2

Code :
  1. # BEGIN W3TC Browser Cache
  2. <IfModule mod_mime.c>
  3.     AddType text/css .css
  4.     AddType text/x-component .htc
  5.     AddType application/x-javascript .js
  6.     AddType application/javascript .js2
  7.     AddType text/javascript .js3
  8.     AddType text/x-js .js4
  9.     AddType video/asf .asf .asx .wax .wmv .wmx
  10.     AddType video/avi .avi
  11.     AddType image/bmp .bmp
  12.     AddType application/java .class
  13.     AddType video/divx .divx
  14.     AddType application/msword .doc .docx
  15.     AddType application/vnd.ms-fontobject .eot
  16.     AddType application/x-msdownload .exe
  17.     AddType image/gif .gif
  18.     AddType application/x-gzip .gz .gzip
  19.     AddType image/x-icon .ico
  20.     AddType image/jpeg .jpg .jpeg .jpe
  21.     AddType image/webp .webp
  22.     AddType application/json .json
  23.     AddType application/vnd.ms-access .mdb
  24.     AddType audio/midi .mid .midi
  25.     AddType video/quicktime .mov .qt
  26.     AddType audio/mpeg .mp3 .m4a
  27.     AddType video/mp4 .mp4 .m4v
  28.     AddType video/mpeg .mpeg .mpg .mpe
  29.     AddType video/webm .webm
  30.     AddType application/vnd.ms-project .mpp
  31.     AddType application/x-font-otf .otf
  32.     AddType application/vnd.ms-opentype ._otf
  33.     AddType application/vnd.oasis.opendocument.database .odb
  34.     AddType application/vnd.oasis.opendocument.chart .odc
  35.     AddType application/vnd.oasis.opendocument.formula .odf
  36.     AddType application/vnd.oasis.opendocument.graphics .odg
  37.     AddType application/vnd.oasis.opendocument.presentation .odp
  38.     AddType application/vnd.oasis.opendocument.spreadsheet .ods
  39.     AddType application/vnd.oasis.opendocument.text .odt
  40.     AddType audio/ogg .ogg
  41.     AddType application/pdf .pdf
  42.     AddType image/png .png
  43.     AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
  44.     AddType audio/x-realaudio .ra .ram
  45.     AddType image/svg+xml .svg .svgz
  46.     AddType application/x-shockwave-flash .swf
  47.     AddType application/x-tar .tar
  48.     AddType image/tiff .tif .tiff
  49.     AddType application/x-font-ttf .ttf .ttc
  50.     AddType application/vnd.ms-opentype ._ttf
  51.     AddType audio/wav .wav
  52.     AddType audio/wma .wma
  53.     AddType application/vnd.ms-write .wri
  54.     AddType application/font-woff .woff
  55.     AddType application/font-woff2 .woff2
  56.     AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
  57.     AddType application/zip .zip
  58. </IfModule>
  59. <IfModule mod_expires.c>
  60.     ExpiresActive On
  61.     ExpiresByType text/css A31536000
  62.     ExpiresByType text/x-component A31536000
  63.     ExpiresByType application/x-javascript A31536000
  64.     ExpiresByType application/javascript A31536000
  65.     ExpiresByType text/javascript A31536000
  66.     ExpiresByType text/x-js A31536000
  67.     ExpiresByType video/asf A31536000
  68.     ExpiresByType video/avi A31536000
  69.     ExpiresByType image/bmp A31536000
  70.     ExpiresByType application/java A31536000
  71.     ExpiresByType video/divx A31536000
  72.     ExpiresByType application/msword A31536000
  73.     ExpiresByType application/vnd.ms-fontobject A31536000
  74.     ExpiresByType application/x-msdownload A31536000
  75.     ExpiresByType image/gif A31536000
  76.     ExpiresByType application/x-gzip A31536000
  77.     ExpiresByType image/x-icon A31536000
  78.     ExpiresByType image/jpeg A31536000
  79.     ExpiresByType image/webp A31536000
  80.     ExpiresByType application/json A31536000
  81.     ExpiresByType application/vnd.ms-access A31536000
  82.     ExpiresByType audio/midi A31536000
  83.     ExpiresByType video/quicktime A31536000
  84.     ExpiresByType audio/mpeg A31536000
  85.     ExpiresByType video/mp4 A31536000
  86.     ExpiresByType video/mpeg A31536000
  87.     ExpiresByType video/webm A31536000
  88.     ExpiresByType application/vnd.ms-project A31536000
  89.     ExpiresByType application/x-font-otf A31536000
  90.     ExpiresByType application/vnd.ms-opentype A31536000
  91.     ExpiresByType application/vnd.oasis.opendocument.database A31536000
  92.     ExpiresByType application/vnd.oasis.opendocument.chart A31536000
  93.     ExpiresByType application/vnd.oasis.opendocument.formula A31536000
  94.     ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
  95.     ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
  96.     ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
  97.     ExpiresByType application/vnd.oasis.opendocument.text A31536000
  98.     ExpiresByType audio/ogg A31536000
  99.     ExpiresByType application/pdf A31536000
  100.     ExpiresByType image/png A31536000
  101.     ExpiresByType application/vnd.ms-powerpoint A31536000
  102.     ExpiresByType audio/x-realaudio A31536000
  103.     ExpiresByType image/svg+xml A31536000
  104.     ExpiresByType application/x-shockwave-flash A31536000
  105.     ExpiresByType application/x-tar A31536000
  106.     ExpiresByType image/tiff A31536000
  107.     ExpiresByType application/x-font-ttf A31536000
  108.     ExpiresByType application/vnd.ms-opentype A31536000
  109.     ExpiresByType audio/wav A31536000
  110.     ExpiresByType audio/wma A31536000
  111.     ExpiresByType application/vnd.ms-write A31536000
  112.     ExpiresByType application/font-woff A31536000
  113.     ExpiresByType application/font-woff2 A31536000
  114.     ExpiresByType application/vnd.ms-excel A31536000
  115.     ExpiresByType application/zip A31536000
  116. </IfModule>
  117. <IfModule mod_deflate.c>
  118.         AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access video/webm application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint image/svg+xml application/x-shockwave-flash image/tiff application/x-font-ttf application/vnd.ms-opentype audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel
  119.     <IfModule mod_mime.c>
  120.         # DEFLATE by extension
  121.         AddOutputFilter DEFLATE js css htm html xml
  122.     </IfModule>
  123. </IfModule>
  124. <FilesMatch "\.(css|htc|less|js|js2|js3|js4|CSS|HTC|LESS|JS|JS2|JS3|JS4)$">
  125.     FileETag MTime Size
  126.     <IfModule mod_headers.c>
  127.          Header unset Set-Cookie
  128.     </IfModule>
  129. </FilesMatch>
  130. <FilesMatch "\.(html|htm|rtf|rtx|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|TXT|XSD|XSL|XML)$">
  131.     FileETag MTime Size
  132. </FilesMatch>
  133. <FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|webp|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|webm|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|_ttf|wav|wma|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|WEBP|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|WEBM|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|_TTF|WAV|WMA|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
  134.     FileETag MTime Size
  135.     <IfModule mod_headers.c>
  136.          Header unset Set-Cookie
  137.     </IfModule>
  138. </FilesMatch>
  139. <FilesMatch "\.(bmp|class|doc|docx|eot|exe|ico|json|mdb|webm|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|pot|pps|ppt|pptx|svg|svgz|swf|tif|tiff|ttf|ttc|_ttf|wav|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|BMP|CLASS|DOC|DOCX|EOT|EXE|ICO|JSON|MDB|WEBM|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|POT|PPS|PPT|PPTX|SVG|SVGZ|SWF|TIF|TIFF|TTF|TTC|_TTF|WAV|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW)$">
  140.     <IfModule mod_headers.c>
  141.          Header unset Last-Modified
  142.     </IfModule>
  143. </FilesMatch>
  144. <IfModule mod_headers.c>
  145.     Header set Referrer-Policy "no-referrer-when-downgrade"
  146. </IfModule>
  147. # END W3TC Browser Cache
  148. # BEGIN W3TC Page Cache core
  149. <IfModule mod_rewrite.c>
  150.     RewriteEngine On
  151.     RewriteBase /
  152.     RewriteCond %{HTTPS} =on
  153.     RewriteRule .* - [E=W3TC_SSL:_ssl]
  154.     RewriteCond %{SERVER_PORT} =443
  155.     RewriteRule .* - [E=W3TC_SSL:_ssl]
  156.     RewriteCond %{HTTP:X-Forwarded-Proto} =https [NC]
  157.     RewriteRule .* - [E=W3TC_SSL:_ssl]
  158.     RewriteCond %{HTTP:Accept-Encoding} gzip
  159.     RewriteRule .* - [E=W3TC_ENC:_gzip]
  160.     RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
  161.     RewriteRule .* - [E=W3TC_PREVIEW:_preview]
  162.     RewriteCond %{REQUEST_METHOD} !=POST
  163.     RewriteCond %{QUERY_STRING} =""
  164.     RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
  165.     RewriteCond %{REQUEST_URI} \/$
  166.     RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
  167.     RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
  168. </IfModule>
  169. # END W3TC Page Cache core
  170. # BEGIN WordPress
  171. # Les directives (lignes) entre 'BEGIN WordPress' et 'END WordPress' sont
  172. # généré dynamiquement, et ne doivent uniquement être modifiées via les filtres WordPress.
  173. # Toute modification des directives entre ces marqueurs sera outrepassée.
  174. <IfModule mod_rewrite.c>
  175. RewriteEngine On
  176. RewriteBase /
  177. RewriteRule ^index\.php$ - [L]
  178. RewriteCond %{REQUEST_FILENAME} !-f
  179. RewriteCond %{REQUEST_FILENAME} !-d
  180. RewriteRule . /index.php [L]
  181. </IfModule>
  182. # END WordPress
  183. AuthType Basic
  184. AuthName "Password Protected Area"
  185. AuthUserFile /kunden/homepages/3/d680005403/htdocs/www/lab/.htpasswd
  186. Require valid-user


 
Note: La raison pour laquelle le RewriteBase est à /blog1/ dans mon blog1, c'est parce que c'était un blog à la racine du serveur, qui a depuis été déménagé dans un dossier fils, au contraire du blog2 qui a toujours existé dans le sous-dossier, lui. Ce n'est peut-être pas très propre, mais c'est la seule solution qui ait fonctionné jusqu'à maintenant. Les deux blogs tapent dans la même base, avec un préfixe différent.
 
Pouvez-vous m'aider ?
Merci d'avance.


Message édité par User Name le 19-05-2020 à 22:47:04

---------------
"Pour diriger un troupeau de 1000 vaches, il faut 1 bâton. Pour diriger un troupeau de 1000 hommes, il faut 1000 bâtons. Pour diriger un troupeau de 1000 français, il faut beaucoup beaucoup de bâtons." - Proverbe africain
mood
Publicité
Posté le 06-05-2020 à 15:33:12  profilanswer
 

n°1117690
patrick_91
Posté le 07-05-2020 à 07:15:04  profilanswer
 

Hello,
 
Oui ce ne sont pas des sous domaines, les DNS ne s'occupent pas de l'arborescence de ton installation sous monsite.com ....  
Un sous domaine porterai le doux dom de : blog1.monsite.com alors que  
monsite.com/blog1   ou  monsite.com/blog2  designent des sous repertoires du site , dans les deux cas le nom de domaine est inchangé;
Exemple de gestion de sous-domaine :  
 
$TTL   86400
asso.fr.  IN  SOA  ns1.nic.fr.   hostmaster.nic.fr.
  (      
         2001122702          ;serial
         86400          ;refresh
         21600          ;retry
         3600000          ;expire
         3600          ;negative ttl
  )      
 IN  NS    ns1.nic.fr.  
 IN  NS    ns2.nic.fr.  
     
g6.asso.fr.  IN  NS    cyclope.ipv6.nic.fr.  
 IN  NS    ns3.nic.fr.  
 
Dans cet exemple g6.asso.fr est un sous domaine de asso.fr   les deux  
sites appartiennent au meme domaine ..  
 
Ce n'est pas le cas de asso.fr/truc  c'est un repertoire du site . Donc les DNS ne peuvent rien pour cela .  
 
A plus  
 
 

n°1117740
User Name
Posté le 07-05-2020 à 12:34:37  profilanswer
 

Salut,
 
Merci pour ta réponse, mais j'ai du mal à y voir plus clair...
Où et comment accéder à la config de l'exemple ci-dessus ? Que dois-je faire précisément ?  
 
Merci.


---------------
"Pour diriger un troupeau de 1000 vaches, il faut 1 bâton. Pour diriger un troupeau de 1000 hommes, il faut 1000 bâtons. Pour diriger un troupeau de 1000 français, il faut beaucoup beaucoup de bâtons." - Proverbe africain
n°1119786
User Name
Posté le 19-05-2020 à 22:46:32  profilanswer
 

En fait, mon problème était lié à l'association de deux soucis :  
- Le plugin W3 Total Cache qui avait créé un .htaccess dans un dossier cache, qui semblait foutre la m*rde
- Le fait que j'avais défini en dur mon URL de sous-domaine dans les propriétés home et siteurl de mon blog Wordpress


---------------
"Pour diriger un troupeau de 1000 vaches, il faut 1 bâton. Pour diriger un troupeau de 1000 hommes, il faut 1000 bâtons. Pour diriger un troupeau de 1000 français, il faut beaucoup beaucoup de bâtons." - Proverbe africain

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Réseaux grand public / SoHo
  Hébergement

  Sous-dossier qui transforme la racine de mon URL en subdomain [Résolu]

 

Sujets relatifs
Nom de domaine .com Indisponible mais .fr DispoAcceder a un groupe avec un PC sous domaine
URL Free inaccessible depuis connection orangeHébergement local, DynHost et sous domaine (depuis OVH)
Site hébergé chez jimdo et nom de domaine chez OVHDossier Nas inaccessible sur mon reseaux
problème d'autorisation d'accès au dossier de mon NASDossier archives Gmail
Configuration d'un dossier partager depuis un NAS Qnappages perso free et dossier photos à télécharger erreur 404
Plus de sujets relatifs à : Sous-dossier qui transforme la racine de mon URL en subdomain [Résolu]


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR