Kumaha CWP ngaluyukeun jalur diréktori folder subdomain?Édit file vhosts

margiplugin WordfenceJalur ngaran domain anu sanés henteu tiasa diseken sacara aman, janten pikeun ngagampangkeun scanning kaamanan plugin Wordfence, perluWordPressJalur subdomain gambar kabeungkeut kana polder nami domain anu sami dina halaman wéb WordPress.

VestaCPJeung cabangna HestiaCP, Anjeun bisa ngaluyukeun jalur diréktori tina folder ngaran domain.

tapi,Panel Kontrol CWPJalur folder ngaran subdomain teu tiasa disaluyukeun pikeun ngabeungkeut jalur dina folder nami domain anu sami.

sapertos,Chen WeiliangBlog geus kabeungkeut kana jalur folder subdomain ▼

/home/用户名/public_html/chenweiliang.com

Lamun nambahkeun ngaran subdomain, teu éféktif pikeun ngabeungkeut jalur dina folder ngaran domain sarua ▼

/home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com
  • Jalur folder ngaran subdomain sapertos kitu teu tiasa ditambihan...
  • Ieu solusina.

CWP custom subdomain ngaran folder prosés jalur diréktori

  1. Mimiti tambahkeun jalur polder nami subdomain (setel misah ti polder nami domain anu sanés):
    /home/用户名/public_html/img.chenweiliang.com
  2. Teras, édit sacara manual file vhosts sareng ganti jalur diréktori folder nami domain ieu:
    /home/用户名/public_html/img.chenweiliang.com
  3. Ganti ku jalur diréktori folder ngaran domain khusus di handap ieu:
    /home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

Kumaha carana ngédit file konfigurasi vhosts di CWP7 tur ngaganti jalur diréktori tina folder ngaran domain?

第 1:Jieun diréktori folder custom ▼

mkdir /home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

第 2:Salin file gambar ka lokasi diréktori polder khusus anu anjeun hasilkeun ▼

cp -rpf -f /home/用户名/public_html/img.chenweiliang.com/* /home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

第 3:Lebetkeun Editor Konfigurasi WebServers, anjeun kedah ngédit file konfigurasi vhosts ngaran domain Nginx nyalira.

Klik "Edit" ngaran domain Nginx vhosts file konfigurasi▼

  • Éditor Konfigurasi WebServers → Setélan WebServer → /etc/nginx/conf.d/vhosts/ → Édit

Kumaha CWP ngaluyukeun jalur diréktori folder subdomain?Édit file vhosts

  • /etc/nginx/conf.d/vhosts/img.chenweiliang.com.conf
  • /etc/nginx/conf.d/vhosts/img.chenweiliang.com.ssl.conf

Lengkah 4: Ganti jalur diréktori folder ngaran domain ieu ▼

/home/用户名/public_html/img.chenweiliang.com

Ganti ku jalur diréktori folder ngaran domain khusus di handap ieu ▼

/home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

第 5:Balikan deui jasa nginx ▼

systemctl restart nginx

第 6:Lebetkeun Editor Konfigurasi WebServers, anjeun kedah ngédit file konfigurasi vhosts ngaran domain Apache nyalira.

Klik "Edit" ngaran domain Apache urang vhosts file konfigurasi▼

  • Éditor Konfigurasi WebServers → Setélan WebServer → /usr/local/apache/conf.d/vhosts/ → Édit

Lebetkeun WebServers Konfigurasi Editor, edit Apache ngaran domain vhosts file konfigurasi No

  • /usr/local/apache/conf.d/vhosts/img.chenweiliang.com.conf
  • /usr/local/apache/conf.d/vhosts/img.chenweiliang.com.ssl.conf
  • Éditor Konfigurasi WebServers → Setélan WebServer → /etc/nginx/conf.d/vhosts/ → Édit

Lengkah 7: Ganti jalur diréktori folder ngaran domain ieu ▼

/home/用户名/public_html/img.chenweiliang.com

Ganti ku jalur diréktori folder ngaran domain khusus di handap ieu ▼

/home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

第 8:Balikan deui jasa httpd▼

systemctl restart httpd

第 9:file .htaccess pikeun nambahkeun alihan ngaluarkeun aturan diréktori folder 

Upami ayaBakal otomatis ngaluncat kana ngaran domain tingkat kadua tanpa ngaran domain tingkat luhur www, Anjeun kudu nambahkeun aturan diréktori folder pangaluaran alihan dina file .htaccess ▼

RewriteCond %{REQUEST_URI} !^/img.chenweiliang.com/.*$ [NC]

Pasang kodeu ieu sateuacan aturan kahiji pikeun ngahontal fungsi pangaluaran diréktori anu ditangtukeun ▼

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/img.chenweiliang.com/.*$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

第 10:Nyegerkeun halaman wéb pikeun ningali upami parobihan éta pangaruh?

  • Tutup CDN subdomain sareng refresh halaman wéb subdomain.

第 11:Nyadangkeun file konfigurasi ka komputer lokal sareng Google Drive

  • Upami dina Setélan WebServers → Pilih WebServer, saatos nyimpen sareng ngawangun deui konfigurasi, eusi file anu diédit sacara manual di luhur bakal teu valid.
  • Éta kedah diédit sacara manual deui, anu nyusahkeun pisan, janten saatos ngedit manual, file kedah dicadangkeun pikeun gancang mulangkeun file konfigurasi anu dicadangkeun.

Di handap ieu paréntah pikeun gancang mulangkeun file konfigurasi vhost cadangan▼

cp -rpf -f /newbackup/backup-vhost-file/nginx-vhosts-file_modified/* /etc/nginx/conf.d/vhosts/

cp -rpf -f /newbackup/backup-vhost-file/apache-vhosts-file_modified/* /usr/local/apache/conf.d/vhosts/

Saatos malikkeun file konfigurasi vhosts cadangan, pastikeun pikeun ngabalikan deui nginx sareng httpd pikeun pangaruh ▼

systemctl restart nginx
systemctl restart httpd
  • Ieu kanggo tujuan catetan sareng inpormasi wungkul.

第 12:使用Leuwih alus Search Ganti pluginnyieun jalur substitusi

jalur ieu ▼

home/用户名/public_html/img.chenweiliang.com

ganti ku ▼

/home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

第 13:Hapus subdomain gambar ▼

rm -rf /home/用户名/public_html/img.chenweiliang.com

第 14:Saatos konfirmasi, balikkeun CDN subdomain

Blog Hope Chen Weiliang ( https://www.chenweiliang.com/ ) dibagikeun "Kumaha carana CWP ngaropea jalur diréktori folder subdomain?Édit file vhosts" pikeun ngabantosan anjeun.

Wilujeng ngabagikeun tautan artikel ieu:https://www.chenweiliang.com/cwl-28218.html

Wilujeng sumping di saluran Telegram blog Chen Weiliang pikeun kéngingkeun apdet panganyarna!

🔔 Janten anu pangheulana kéngingkeun "Panduan Penggunaan Alat AI Pemasaran Konten ChatGPT" dina diréktori luhur saluran! 🌟
📚 Pituduh ieu ngandung nilai anu ageung, 🌟Ieu mangrupikeun kasempetan anu jarang, tong kantun! ⏰⌛💨
Bagikeun sareng suka upami anjeun resep!
Bagikeun sareng resep anjeun mangrupikeun motivasi kontinyu kami!

 

koméntar

Alamat email anjeun moal diterbitkeun. Widang anu diperyogikeun dianggo * Labél

gulung ka luhur