WordPress rewrite multisite blog url

I have a plugin which creates sites progmatically. What I need to do is ad a /s/ inbetween the domain and the site name in the URL.

So

http://domain.com/site-name/

becomes

http://domain.com/s/site-name

I have changed the sites url by adding /s/ to the path when calling wpmu_create_blog() .

I now need to update the rewrite rules to cater for the added s.

add_rewrite_rule(‘^/s/([0-9]+)/?’, ‘index.php?’, ‘top’);

What do I add to index.php so that the site will load correctly?

Read more here:: WordPress rewrite multisite blog url

Leave a Reply

Your email address will not be published. Required fields are marked *