Need to redirect deactivated subsite

I have deactivated a subsite and the existing URL to that subsite shows a message
This site does not exist
which is correct..
https://zeiss-youandeye-awards.fourplusmedia.com/
However instead of this I'd like it to be redirected to another URL.. Can I do this? Please advise..

And also do let me know what's the difference between Deactivating and Archiving a subsite?

  • Predrag Dubajic
    • Support

    Hey Alim,

    Adding something like this in your .htaccess should take care of the redirect from that subsite:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^zeiss-youandeye-awards.fourplusmedia.com$ [NC]
    RewriteRule ^(.*)$ https://fourplusmedia.com%{REQUEST_URI} [R=301,NC,L,QSA]

    My example code will redirect to main site, but you can change the destination URL to anything you want.

    And also do let me know what's the difference between Deactivating and Archiving a subsite?

    Basically, when you deactivate a site you have gone one step back in site creation process, for example, when you register new subsite on network you will get an activation email that needs to be confirmed before the site is activated, and this redoes that step and the site is deactivated, meaning both front and backend of the site are not available.
    Archiving a site will apply only on the frontend, so you could still make changes in backend with admin account.

    Best regards,
    Predrag

  • Alim Bolar
    • Site Builder, Child of Zeus

    The RewriteEngine On was already mentioned on the first line so I didn't add that line and then I added these lines

    RewriteCond %{HTTP_HOST} ^zeiss-youandeye-awards.fourplusmedia.com$ [NC]
    RewriteRule ^(.*)$ https://youandeyemag.com/awards%{REQUEST_URI} [R=301,NC,L,QSA]

    RewriteCond %{HTTP_HOST} ^vpacademy.fourplusmedia.com$ [NC]
    RewriteRule ^(.*)$ https://visionplusmag.com/vpacademy%{REQUEST_URI} [R=301,NC,L,QSA]

    But it's not working.. please do advise.. it's a bit urgent..

  • Predrag Dubajic
    • Support

    Hi Alim Bolar,

    I have tested the redirect rules on my subdomain test site before posting it here and it worked fine for me, and just to be sure I gave it another test now and it still works fine.
    It seems that there's something specific on your end preventing these rules from working and the first thing I would suggest is checking your .htaccess file and leave only default WP rules and the redirect one in there to see if other rules in there are interfering with this.

    If that doesn't work try clearing any caching that you may have, both site and server ones, and then proceed with a conflict test by disabling your plugins and switching to default WP theme to see if there are any redirects from there that are causing the issue.

    If neither of those help I would suggest getting in touch with your hosting provider so they can check your .htaccess and see why this rule isn't working for you.

    Best regards,
    Predrag

  • Alim Bolar
    • Site Builder, Child of Zeus

    Hi Predrag

    Thanks for the update.. I cleared the server cache using Hummingbird but I was still having the same issue (no effect) when I try to type https://vpacademy.fourplusmedia.com

    but before do the plugin test etc.. I just wanted one confirmation, when I archive a site I am assuming the frontend gets disabled and but I can still work on the admin side.. am I right?

    I have archived vpacademy.fourplusmedia.com but it's still showing on the frontend... please do visit https://vpacademy.fourplusmedia.com and confirm..
    Here's the screenshot to confirm it's been archived

    And I assumed I should be able to see it in the admin view but this screen says the site is as good as 'dectivated' (coz I can't see it in the admin view)..

    What am I doing wrong? Please advise.

    Regards,
    Alim

  • Adam Czajczyk
    • Support Gorilla

    Hello Alim Bolar

    If the site is "archived" it's pretty much "suspended". It should not be visible on front and and available in any other way except for a logged in super-admins.

    The site you linked to seems to be fully available - I can easily visit and view it as a visitor (without even logging in) so that suggests that there is something not quite right with this. I think this might be cache related.

    Are you by any chance using CloudFlare for the site? If yes, make sure that cache is cleared there.
    If there's any cache on multisite and, especially, on server clear it up too. Depending on where you're hosting your site, you might also flush object cache on server - if there is any.

    Have you tried that already?

    Best regards,
    Adam

  • Alim Bolar
    • Site Builder, Child of Zeus

    Hi Adam

    Thanks for the response and update...

    I am using hummingbird but it says it clear page cache (is it different from server cache?)

    flush object cache on server... what does this mean and how do I do this? I am currently hosted on digitalocean

    Regards,
    Alim

  • Adam Czajczyk
    • Support Gorilla

    Hi Alim Bolar

    Yes, Hummingbird's "Page Cache" is a different thing that any kind of "server side cache". A "Page Cache" is created by plugin's PHP script. A simplified explanation is that when the page is requested, plugin "intercepts it" and instead of serving it to the visitor, it - kind of - prints it to the static file. Then this file is served to the visitor.

    In general, when plugin "sees" that somebody requests a page it check if a static file already exists on server disk for that page and if so, it gives it to the visitor - which is much faster than letting WordPress dynamically build-up the site by executing multiple PHP scripts, fetching multiple data from the database and putting it together in real time.

    Despite of this, there can also be a "server side cache", meaning that the entire caching system is not run "within your WordPress site" but on a server level. There can be different kinds of such cache - there can be a cache similar to the one described above but created on "system level" but also so called "object cache", which is basically a system tool that intercepts results of the database queries. As a result, if WordPress makes a database query, the result is quickly returned by that cache instead of executing entire query, doing search and so on.

    That's a bit simplified explanation but should give you a basic ideas :slight_smile:

    That being said, if you're hosting with Digital Ocean that means that you got some droplet there but whether it's got cache or not and what kind of it - I'm really not sure. That'd mostly depend on the droplet (server) configuration. Do you have some sort of management panel there? If yes, look for any options that might be related to cache by the name.

    Also, you should be able to login to the server using SSH - are you familiar with using SSH? If yes, you can try running a WP CLI command there:

    wp cache flush

    If you got WP CLI available there, object cache would be cleared then; if not, you'll just receive an error message and that's all.

    But if that doesn't help with that archived site and/or you're not feeling comfortable with trying this, let me know and I'll see what else/more we could do about it :slight_smile:

    Best regards,
    Adam

  • Adam Czajczyk
    • Support Gorilla

    Hello Alim Bolar

    I don't think it'll be necessary in this case, if it's not there already :slight_smile:

    I read the thread again and I think I'd need to take a closer look at this, as I'd prefer to not go the "guessing/assume" way :slight_smile: I would need a direct access to the site/server though. Would you be able to provide me with such access credentials?

    Note: Don't leave your login details in this ticket.
    Instead, you can send me your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: "Attn: Adam Czajczyk"
    - Site login URL
    - WordPress admin username
    - WordPress admin password
    - FTP credentials (host/username/password)
    - cPanel credentials (host/username/password)
    - Folder path to site in question
    - Link back to this thread for reference
    - Any other relevant urls/info

    I'll check both issues then - the archived site and redirects :slight_smile:

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.