WordPress.org

Ready to get started?Download WordPress

Forums

multisite permalinks: how to prepend all subsites urls with a virtual folder (4 posts)

  1. pixeline
    Member
    Posted 1 year ago #

    For our school we use a wordpress network. The main domain gives access to general information and sub-sites are specific projects managed by students.

    I would like that all sub-sites have their url appended with a fake folder name.

    example

    Say the main domain is school.edu

    Currently, my sub-sites permalinks are

    school.edu/project1/
    school.edu/project2/

    I would like that they becomes:

    school.edu/projects/project1/
    school.edu/projects/project2/

    How can i do it?

    I tried adding this in a .htaccess. It redirects correctly but then the url is changed back to the "real" one.

    RewriteRule ^projects/([_0-9a-zA-Z-]+/)? $1 [R=301,L]

  2. Doesn't work that way. You'd want to use a multinetwork plugin, make a network called projects, and put those sites in there.

  3. pixeline
    Member
    Posted 1 year ago #

    Your solution makes sense, but it seems 3.5 has issues in multisites mode. I tried that and the subnetwork never gets created.

  4. Jesús Franco
    Member
    Posted 1 year ago #

    @pixeline I've done funny things with rewrite rules before, and it's not really the best way to go, however if you really need that support, you could try pruning the Redirection flag of your rewrite rule, that way the redirection it's going to be transparent to the user (the won't see the "real" URL). However I don't know if it could create conflicts with your permalinks.

Topic Closed

This topic has been closed to new replies.

About this Topic