localhost - change wordpress upload url to subdomain on xampp local

admin2025-06-02  1

Firstly, I am sorry for bad English Language

I want to make a site using wp on local with xampp 3.2.2 (win10)

To avoid future problems (e.g changing domain after moving to live or changing media file path in db) i stablish a virtual host & a subdomain by putting this code in httpd-vhosts.conf

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName xyz
    ServerAlias xyz
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp/htdocs/xyz"
</VirtualHost>


<VirtualHost *:80>
    ServerName dl.xyz
    ServerAlias dl.xyz
    ServerAdmin [email protected]
    DocumentRoot "C:/XAMPP/htdocs/xyz/dl"
</VirtualHost>

& this code to httpd.conf

Alias /xyz "C:/XAMPP/htdocs/xyz/"
<Directory "C:/XAMPP/htdocs/xyz/">
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
  • then i check subdomain to making sure it's working by making simple index.html to "dl" DIR (dl.xyz) & work Properly.
  • then I install wp and after some configuration I follow this article step to change WordPress default upload path:

/

This is my database change:

upload_path:

C:/xampp/htdocs/xyz/dl/uploads

upload_url_path:


I change "dl" DIR permission As described here: In this way: dl Folder properties >> sharing Tab >> Advanced Sharing >> check share this folder >> Permissions >> select Everyone as username >> check Allow option for "full Control" "Change" "Read" this is 777 permissions

now when i want to upload file to media this error appeared:

Unable to create directory C:/xampp/htdocs/xyz/dl/uploads/2019/02. Is its parent directory writable by the server?

Firstly, I am sorry for bad English Language

I want to make a site using wp on local with xampp 3.2.2 (win10)

To avoid future problems (e.g changing domain after moving to live or changing media file path in db) i stablish a virtual host & a subdomain by putting this code in httpd-vhosts.conf

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName xyz
    ServerAlias xyz
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp/htdocs/xyz"
</VirtualHost>


<VirtualHost *:80>
    ServerName dl.xyz
    ServerAlias dl.xyz
    ServerAdmin [email protected]
    DocumentRoot "C:/XAMPP/htdocs/xyz/dl"
</VirtualHost>

& this code to httpd.conf

Alias /xyz "C:/XAMPP/htdocs/xyz/"
<Directory "C:/XAMPP/htdocs/xyz/">
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
  • then i check subdomain to making sure it's working by making simple index.html to "dl" DIR (dl.xyz) & work Properly.
  • then I install wp and after some configuration I follow this article step to change WordPress default upload path:

https://www.webnots/move-wordpress-images-folder-to-subdomain/

This is my database change:

upload_path:

C:/xampp/htdocs/xyz/dl/uploads

upload_url_path:

http://dl.xyz/uploads

I change "dl" DIR permission As described here: https://www.youtube/watch?v=mX2WsUfW_x4 In this way: dl Folder properties >> sharing Tab >> Advanced Sharing >> check share this folder >> Permissions >> select Everyone as username >> check Allow option for "full Control" "Change" "Read" this is 777 permissions

now when i want to upload file to media this error appeared:

Unable to create directory C:/xampp/htdocs/xyz/dl/uploads/2019/02. Is its parent directory writable by the server?

Share Improve this question edited Feb 6, 2019 at 15:35 Payam Baharan asked Feb 6, 2019 at 8:11 Payam BaharanPayam Baharan 112 bronze badges 1
  • Please put your permissions procedures inside the question instead of linking to the video. – Max Yudin Commented Feb 6, 2019 at 8:27
Add a comment  | 

1 Answer 1

Reset to default 1

Problem was / in upload_path: That most change to\ C:/xampp/htdocs/xyz/dl/uploads C:\xampp\htdocs\xyz\dl\uploads

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748832708a314098.html

最新回复(0)