We use cookies to improve our services and provide a better experience. By continuing to use this site, you agree with our Cookies Policy.

Tutorials
More than 400 step-by-step articles to guide you through online project development.
HomeTutorialsCMS TutorialsWordPressWordPress Administration

How to add a file to root directory of multisite

Brazil VPS
Linux KVM Hosting
OpenVZ VPS
Germany Cloud Servers
USA VPS
Linux Cloud Server
KVM VPS
cPanel KVM
Windows Cloud Server
Ubuntu VPS

Lets say we have lots of websites by using WordPress multisite feature and we want to add a file to root directory of each file. This can be done easily by using single directive in .htaccess file.

  • First of all, upload the file to the hosting account. It may be uploaded to WordPress installation directory. For example, if it’s uploaded to “public_html/wp-content/file” and the permalinks structure is set to domain.com/file/file.txt,  but we want it to be accessible over domain.com/file.txt.
  • Open .htaccess file for editing. Usually it can be found in the public_html of WordPress installation directory.
  • Insert the following line to set redirect action: RewriteRule ^file.txt /file/file.txt [L]
  • Save and close .htaccess file to apply the changes and check how redirect is working in live websites.

Linux Cloud Server
Windows Cloud Server
Linux KVM Hosting
USA VPS
Germany Cloud Servers
KVM VPS
OpenVZ VPS
Ubuntu VPS
cPanel KVM
Brazil VPS
Rate this Tutorial:
No Comments Leave a Comment
Leave a Comment

Other (182)

Popular Keywords