files – How can I restrict access to a static HTML page served from a subfolder of my site to authenticated users only?

I have a Drupal 8 site that has all roles and permissions necessary for authenticated users. One of the new requirements is to serve a static microsite (like a campaign site, totally different design compare to Drupal site) which is a single folder with all the static assets (HTML, CSS, JS , images). We have to serve this site under the same domain drupal is hosted and should be accessed ONLY by authenticated users.

I tried to host it under sites/default/files/ directory, but it means it is public and anyone can access it.

windows – Deleting every subfolder in a directory that DOESN’T contain certain file extensions (mp3/flac/wav)

I want to delete every folder in a certain directory that doesn’t contain music files (mp3/flac/wav/etc).

I’m doing some retagging of files using Mp3Tag which also moves it in (new) folder with the structure:

ArtistAlbumArtist Name - Album - Track Number - Track.ext

This results in the old subfolders without any music files (mp3/flac/wav/etc) while leaving remnants of cover.jpg or log files and etc.

I want to delete any subfolders without any music files (mp3/flac/wav/etc) automatically using a batch file.

I’ve been trying to take a stab at it, but can’t really come up with anything fruitful.

Can anyone lend a hand? Thanks.

multisite: redirects users to their subfolder on the multisite network and hides wp-admin and admin bar

Can anyone help and suggest a snippet for subsite users, when they sign in using mainsite.com/login, to redirect them to mainsite.com/subsite? I read that it is a default for WordPress multi-site installs, but it doesn't work.
Since I am using WP Ultimo, I have a snippet that redirects users after registration:

add_filter('wu_gateway_get_url', 'my_custom_url_redirect_after_payment', 10, 2);
function my_custom_url_redirect_after_payment($url, $page_slug) {
      return $page_slug == 'success' ? home_url() : $url; }

How to redirect users after logging into your subsite? I tried this snippet for subsite redirection, but it doesn't work:

function uop_login_redirect( $redirect_to, $request, $user  ) {
    return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url() : site_url();
}
add_filter( 'login_redirect', 'uop_login_redirect', 10, 3 );

/////Hide Admin bar
add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}

Can anyone help, how to hide wp control panel and admin bar for all users except administrator?

seo – Subdomain vs Subfolder for billing software; Specifically Knowledge Base, Downloads, Status Pages

Introduction

"Subdomain vs. Subfolder" Yes, this question has been asked many, many times, but I will try to ask it in a way that is not considered a duplicate, as my question is more about some of the features than the more modern billing and systems automated hosting. provide.

Correct me if I'm wrong, but I've read that when it comes to search robots, specifically google, subdomains and subdirectories are the same. But reading some Moz articles shows that there have been cases in conflict with what Google claims; specifically that subdomains can act as their own autonomous website.

Reading a post on Cloudflare puts it this way:

A subdomain is the same and different from a root domain. This means that the keywords for a subdomain are treated separately from the root domain.


Current configuration / Question

Now my question comes from some features that the billing software offers that I would rather not separate from the main domain. Specifically, the Knowledge Base, but also a download and server status section, albeit to a lesser extent.

I currently have a frequently asked questions page setup in my main subdomain which is www.domain.com (redirects other than www to www). Most of my website is on this main site (www.domain.com). I have set up a billing system hosted on a different server under one subdomain, let's call it my.domain.com.

I'd really like to start using the knowledge base that is built into the billing software CMS on the current / FAQ page that doesn't run on any type of CMS. This would make it much easier to manage, add and edit any information in these sections of the site.

But do I risk losing these keywords that would normally be associated with my main website (www.) Because now they would be hosted in my billing CMS subdomain?

One solution I thought of was having my billing software located on the main www. but in a subdirectory instead of a subdomain. For security reasons, the billing CMS would still be hosted on a different server, but you would simply configure a reverse proxy for www.domain.com/billing/etc … to load the billing CMS.

Am I stop thinking this?


Direct questions

  1. Hosting a billing CMS in a subdomain is not a problem, but would the billing CMS knowledge base pages be associated with my primary domain or only the subdomain from which the billing CMS is accessed?

  2. Is it a good idea to use a reverse proxy to allow access to the billing CMS in a subfolder instead of from a subdomain?

  3. Are there issues or problems that I just don't see when it comes to where my FAQ / Knowledge Base, Downloads, Status pages are accessed?

htaccess: hide the subfolder so that it does not appear in the URL

I want to go from www.xyz.com// randomfolder at xyz.com/randomfolder,
1. you must access the contents from /
/ randomfolder nly but it should show xyz.com/randomfolder
What I have tried:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www. (NC)
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 (R=301,L,QSA)
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} (L,R=301)

Problem: It completely fills my / _ / randomfolder requirement but it should show xyz.com/randomfolder but it affects my main domain xyz.com, it doesn't show anything. 404 page I want it to show public_html / index.php only.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#To load site from  /_/xyz to /xyz  without hcanigng url
RewriteRule ^(A-Za-z0-9._)+  /_/%{REQUEST_URI} (L)

Problem: I have to manually change the address bar from www.xyz.com/_/randomfolder to xyz.com/randomfolder, it loads content with or without _ but the first time it loads your redirects to / _ / random folder

sharepoint server – How do I delete folders in a subfolder of a folder using powershell?

There is a document library folder called "Request Documents." There are folders in this Library folder. Again, under each folder there is another folder in it. I need to delete this folder. But I can't delete it.
With the following code, I can delete the files inside the folder but not the folder. The message is displayed in the capture. Can someone help me with this?

   Function GetFiles($Folder)
  { 
   Write-Host "+"$Folder.Name
    #Loop through all subfolders and call the function recursively
    foreach ($SubFolder in $Folder.SubFolders)
    {
    if($SubFolder.Name -ne "Forms")
        {  
            Write-Host "`t" -NoNewline
            #Write-Host "+"$SubFolder.Name
            foreach($semisubfolders in $SubFolder.SubFolders)
            {
            if($semisubfolders.Name -eq 7754)
            {
                Write-Host "+"$semisubfolders.Name

                    try{
                         #$semisubfolders.Delete($semisubfolders)
                $SubFolder.SubFolders.DeleteItemById($semisubfolders.Item.ID)
                      write-host "Folder Deleted"
                       }
                    catch{
                            write-host "Not deleted or already deleted"
                       }


                       foreach($file in $semisubfolders.Files)
                       {    
                        Write-Host "Deleted File:" $file.Name
                        $Abcd.Items.DeleteItemById($file.Item.Id)
                        write-host "Deleted"
                       }

            }



        }



}



#Get the Site collection 
#$Site= Get-SPSite "http://idn-mapis2:1111/" 
    foreach($list in $web.Lists)
    {
        if($list.Title -eq "Request Documents")
        {
            GetFiles($List.RootFolder)
        }
    }

IIS URL Rewrite – Redirect Root to Subfolder

I want: http://somesite.com to redirect to http://somesite.com/subfolder

It seems a fairly simple request. I have followed the online sources, and they all indicate that I should use ^$ for the regex pattern. I have also added an HTTP redirect to HTTPS, and it works fine. I've also tried to disable that rule just to make sure it doesn't interfere. This runs on IIS 10 / Server 2016.

My web.config looks like this:



    
        
            
                
                
                    
                    
                    
                
                
                    
                    
                        
                    
                    
                
            
        
    

Root domain requests are not redirected. Why is it not working?

copy: Python to extract data in the zip file to the destination folder. The zip file has the subfolder

First, below is the structure of my zip file. You can see below the .zip file, there is also a subfolder & # 39; temp & # 39; and another subfolder & # 39; tdms & # 39; followed. And the data is the subfolder & # 39; tdms & # 39 ;.
enter the description of the image here
My zip file structure:

I wrote the following code to copy the data to the destination folder. However, not only can you copy the data, you copied the subfolders together.

folder1='C:/Users/sunw8/Desktop/1200/Field-follow support/LTN00201/test1/'
folder2='C:/Users/sunw8/Desktop/1200/Field-follow support/LTN00201/test2/'
for zFile in os.listdir(folder1):
    file_zip=zipfile.ZipFile(os.path.join(folder1,zFile), mode='r')
    print(file_zip.infolist())
    for unZip_tdms in file_zip.namelist():
        path_tdms=os.path.join(folder1,unZip_tdms)
        tdms_name=path_tdms(-33:)
        print(path_tdms)
        print(tdms_name)
        print(unZip_tdms)
        #break
        #ab_tdms=os.path.abspath(re_tdms)
        if path_tdms not in os.listdir(folder2):
            file_zip.extract(unZip_tdms,folder2)
    file_zip.close()

You can below the results of my code. However, I just want to copy the data to the destination folder and I don't want the subfolders together.
enter the description of the image here

Copy the sub-folder of Sharepoint (template) and apply copy permissions

Is there any way to amend this script here:

https://sharepoint.stackexchange.com/a/263621/89177

to be able to copy / create and apply permissions to subfolders? (For example: https://micrososft.sharepoint.com/sites/hgs_demo -> LibraryName -> Template Folder -> SubFolder 1, etc.

I have tried to amend the variables but do not seem to be able to "find" subfolders.

AUNT
Phil

Subdomain: Do you use a domain, subdomain or subfolder to add a physical location to an existing content website?

We currently have a global photography website located at https://phmuseum.com. We will add a physical location, school space / events in Bologna, Italy this year. We will be targeting the services of this physical location primarily to local Italians, but also to a lesser extent to Europeans and worldwide.

We will create a microsite for reservations and promotion of this space in Italian and English.

What would be the best route to follow in terms of guidance and SEO to add this website to our current offer? In my view, there are some options or a combination of the following:

We could even be hyperlocal with https://phmuseumspace.bo.it

Any ideas, recommendations or suggestions would be welcome.