Where is htaccess for WP 3.01 Multi-site (14 posts)

  1. Jay
    Posted 5 years ago #

    Before moving to WP 3.X Multi-site I used to go into my .htaccess and do Redirect 301 for URL's. Since moving to a multi-site on a sub-domain I don't know where to find htaccess. It appears the one in the root is only for the main site. I have my permalink structure set up as /%category%/%postname%/

    Anyone able to point me in the right direction.

  2. dgilmour
    Posted 5 years ago #

    The .htaccess used by Multisite to rewrite requests for sites will be in the root of your WordPress installation. You might not have had one before using Multisite, but will have needed to add lines to it as part of the installation process. That one handles main site and subsites. They don't get their own, as they're virtual: they don't have their own directory structures.

  3. The file is also hidden becasue it starts with the dot in front. You may not be seeing it, becasue if you have pretty permalinks, you're already using an .htaccess file.

    Tell your ftp program or your cpanel to show hidden files.

  4. Jay
    Posted 5 years ago #

    Thank you for the replies.

    Yes I am aware it is a hidden file. I have been using it for years to redirect bad url's reported from Google Webmaster tools.

    I guess I assumed the root .htaccess would not work the same way with the sub-domain since the only way I could get it to work was by putting only the prettylink portion such as this
    'Redirect 301 /category/statistics http://www.mydomain.com/market-statistics'

    If I were to put the http://mydomain on the source URL it would not work. So since getting the advice that there is only the one htaccess I tested it the same as the example above, and it works.

    But my next question is this; if for some reason a bot or user went to a permalink like http://mydomain2.com/category/statistics which would be a different site on my multi-site installation then they would be redirected to the wrong site. I also double checked, and on a redirect 301 I can not put the domain for the source URL it has to only be the prettylink portion.

    Hope this is clear enough to get the help I am looking for, just trying to give all the info I can.

  5. Your .htaccess file for Multisite is in the exact same place it always is. This Redirect 301 /category/statistics http://www.mydomain.com/market-statistics tells me you're not using Multisite 'right' if at all. The category flag in that URL is called from your MAIN site.

    Did you, perhaps, MOVE a category to it's own blog on Multisite?

  6. Jay
    Posted 5 years ago #

    Sorry maybe I was not clear, that is the way I used to do it when I was using a standalone site on 2.9. I am wanting to accomplish the same thing without a plugin. I did test this way on the multi-site and it works, but as you pointed out not the way it is suppose to, because this way everything coming to any domain.com/category/statistics on the multi-site is going to go to mydomain.com/market-statistics/

    Keep in mind I am just redirecting things webmaster tools points out, which means at some point and some where someone is pointing to my site incorrectly. I am also sure my multi-site is active and working and I am using domain mapping.

  7. You can include specific subdomains on htaccess redirects, if that helps. But yeah, you're doing a bit of a funky chicken here :)

    Google subdomain redirection and you should get it so you can sort spcificdomain.com/category/statistics to where you want.

  8. Jay
    Posted 5 years ago #

    Redirect 301's won't work with the domain.com included on source to be redirected, on a standalone or multi...just the way it is.

  9. No, I think you can do this....

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^/category/statistics(.*)$ http://www.mydomain.com/market-statistics/$1 [r=301,nc]

    Something along those lines SHOULD work. you may need to play with it a bit, but you CAN redirect based on what domain gets sent to WordPress. You'll want that ABOVE any WP specific calls, mind.

  10. Jay
    Posted 5 years ago #

    I am back on this, and am really banging my head with it.

    I can not get every redirected url from any of the other sub domains or from the primary site to not redirect to the destination page.

    I have tried so many variations and put it at the top and bottom and everything else. I just need someone smart than me to write it. ipstenu's response makes sense to me but can not get it to work.

  11. yumiam
    Posted 5 years ago #

    Hi Did you find the solution ?
    i have the same problem...

  12. Jay
    Posted 5 years ago #

    Not really, I did get 301 redirects to work but only for the main domain not the child sites.

  13. yumiam
    Posted 5 years ago #

    okay, thank you for your answer...
    did you try this plugin ? http://urbangiraffe.com/plugins/redirection/

  14. Jay
    Posted 5 years ago #

    I looked at it I believe but wanted to avoid a plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.