简体   繁体   中英

Install Wordpress in subdomain on shared hosting

I'm trying to install Wordpress in a subdomain on a shared hosting.

Me and my father have a domain together - artazov.cz . I have my own subdomain michal.artazov.cz . I want to go one level deeper and make a blog in the subdomain of the subdomain - blog.michal.artazov.cz . Now, it shouldn't matter, how many levels deep I go if I match it directly with regular expression in .htaccess . So that's what I did:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/?subdom/michal/subdom/blog/
RewriteCond %{HTTP_HOST} ^(www.)?blog\.michal\.artazov\.cz [NC]
RewriteRule ^(.*)$ http://artazov.cz/subdom/michal/subdom/blog/$1 [L,P]

There are 2 problems with this.

  1. Wordpress by default is set up in a way, that in General settings, "Site Address (URL)" is set to http://artazov/subdom/michal/subdom/blog . Therefore every link on the website, including permalinks to articles, have this signature, instead of http://blog.michal.artazov.cz .
  2. When I change that setting to http://blog.michal.artazov.cz , the website returns 404 Not Found and I have to go to database and change it back.

Is there some way to set it up so it works and runs in the desired subdomain, including all the links, generated by Wordpress itself? Thanks

Perhaps you have attempted likely to: Configurations in Wordpress-Admin >> Media Configurations Then try altering both:

I think you may should try changing permalinks: http://codex.wordpress.org/Using_Permalinks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM