最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Wordpress deleting subdomain from the URL

programmeradmin4浏览0评论

Finally I've solved the wildcard subdomain for my hosting. But now I'm facing another problem.

If you try then it will redirect for the main domain and wordpress deleting the given data. If you try this link: / you can see its a simple php page and now the subdomain stays there, and I can processs the given info on the site.

Okay the SSL have to be setup somehow later, not sure how could I do that since I'm just using Easy SSL now, and I don't see wildcard subdomain options but thats a different tale. Right now I would be happy if Wordpress not deleting the subdomain from the URL.

Maybe its some edit needed in the MySQL tables, or are there any easier options?

Finally I've solved the wildcard subdomain for my hosting. But now I'm facing another problem.

If you try https://randomname.minepi.hu then it will redirect for the main domain and wordpress deleting the given data. If you try this link: https://randonname.minepi.hu/test/ you can see its a simple php page and now the subdomain stays there, and I can processs the given info on the site.

Okay the SSL have to be setup somehow later, not sure how could I do that since I'm just using Easy SSL now, and I don't see wildcard subdomain options but thats a different tale. Right now I would be happy if Wordpress not deleting the subdomain from the URL.

Maybe its some edit needed in the MySQL tables, or are there any easier options?

Share Improve this question asked Sep 29, 2020 at 15:46 Arpad PalinkasArpad Palinkas 1
Add a comment  | 

2 Answers 2

Reset to default 0

Do you use Multisite mode for WP?
If not, the mechanism for enabling Multisite mode is shown below:

Edit wp-config.php and enable the option :

define( 'WP_ALLOW_MULTISITE', true );

Next, in the control panel, find the network Setup tab in the Tools section. Select the address format for the network. Update your files wp-config.php:

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'new-multisite-setup.dev');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

and .htaccess :

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

In your control panel you will find a new option in the admin navigation menu called Sites. Go to the Sites tab and add your subdomain by filling in all the fields. After that, the problem with the transition should stop.

Okay I found the answer. I had to add this to wp-config.php:

define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
发布评论

评论列表(0)

  1. 暂无评论