简体   繁体   中英

wordpress permalinks with prefix for wildcard

I'm having trouble trying to program into Wordpress a wildcard for the permalink structure. So for example, I'm trying to setup a permalink where the link is like this: foo.example.com/company. At the moment, the wildcard is in place for the URL (foo.example.com), but the permalinks are still under the root (example.com/company). Is there a way to program it so that the permalink will be matched exactly to the URL that is written. So if I entered in dsdd.example.com, the permalinks will display dsdd.example.com/company, etcc...

This kind of thing is way over my head, so if someone could provide some code examples of how to accomplish this, it would be much appreciated. Thank you.

I'm not sure what your current setup is, but I can offer advice based on my prior experience with web hosts and WordPress.

If you want to have something where the subdomain (something.example.com) is a wildcard (thiscouldbeanything.example.com) and still point to your WordPress installation, you're going to have to get your host to set up something called a Wildcard DNS Record

From your description, you might have this set up already. If so, cool.

Using the wildcard is another story. Personally, I would go with a .htaccess file, and use mod_rewrite in order to have it use the wildcard subdomain to be used in the URL.

WordPress MU (Multi User) uses something along these lines to help you set up a subdomain network, and you can probably use their .htaccess file demonstrated here

Without REALLY specific information about your setup and goals, I couldn't be as much help as I wanted to be, but good luck!

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