Wordpress - allow files in site root to be accessed - wordpress

I have a wordress site but I have a simple page which is not part of the wordpress project
http://sitetest.com/mypage.php
How can I make wordpress ignore this file and allow it to be shown

Just upload this php file to your /public_html directory and run as usually http://sitetest.com/mypage.php, it should work.
UPD. I checked and it works for me.

Just put the file in the site root folder. It will be accessible.
Example: if your site root is /var/www/html/ or public_html then put the file in html/public_html folder where others WordPress files & folders are like wp-content, wp-includes, wp-admin etc.

Related

Hide WP-includes, and WP-content/uploads from WordPress

I am using WordPress, I have to hide WP-includes, and WP-content/uploads from WordPress. I have tried to add the below code in htaccess
Options -Indexes
Also, I have referred to this link but still, it's not working for me.
The below link is working
http://localhost:8080/wordpress/wp-includes/
but if I add then I can see all the files. Same for the upload folder
http://localhost:8080/wordpress/wp-includes/assets
http://localhost:8080/wordpress/wp-content/uploads/2022/01
Note-localhost is just an example
Where does the .htaccess file exist on the server? Which path?
Are you sure your web server is processing this file? Are you indeed running Apache?
As long as you have a file named .htaccess (no spaces), and it's placed in your root HTML folder, or within both wp-includes and wp-content folders, and somewhere within the file on its own line, you have Options -indexes, this should be respected for all subfolders and turn off auto-indexing. Can you share the entire contents of this file, perhaps you have placed this line somewhere it's not being read.
After some research, I have created a .htaccess file in the wp-content/uploads and added the below code. And it's started working
# Kill PHP Execution
<Files ~ ".ph(?:p[345]?|t|tml)$">
deny from all
</Files>

Plesk default page while Wordpress is installed in httpdocs

The default plesk page displays while there is a Wordpress installation in httpdocs. What do I change to display the Wordpress installation? The page came out of nowhere, we made no changes to the website.
Delete the file named welcome.php or something like that in the httpdocs folder or try to reinstall WordPress if that doesn't work.
There's an order of loading files from the httpdocs, and usually index.html is before index.php - so if there's an index.html AND an index.php in the folder, then index.html is loaded before index.php.
So, if you have index.html in your folder try deleting that. (Or delete everything that's not Wordpress.)
Or you could just delete everything in that folder and reinstall WordPress.

Can I unzip WordPress folder directly into htdocs folder?

Can I unzip WordPress folder directly into htdocs folder without creating WordPress folder in it?
To unzip wordpress.zip inside htdocs folder, one blank folder should be there.
So first create blank folder that unzip wordpress.zip inside that folder.
Thanks,
Yes you can, the wordpress files should be installed in the DocumentRoot for the website which I think in your case is the htdocs folder.
When you unzip it it will unzip with a wordpress folder, just move the contents of the folder up a level and remove the wordpress directory.
You just need to configure your wp-config.php file with the relevant access details for the database connection

How to redirect wordpress (installed inner directory) to main root address?

I've installed wordpress into a inner directory. like root/mysite . Why I didn't install it on root because there are so many addon domain installed, and I literally don't want to mess all addon domain folders with wordpress files inside root directory. My root directory is for www.example.com . And my wordpress site I've installed on root/mysite, so the url for that is www.example.com/mysites . Is there anyway to redirect www.example.com/mysites to www.example.com . As I said the only reason for not installing wordpress on my root, because I don't want to mess wordpress files, folders with other addon domain's folders on root.
So my main goal is showing a wordpress site on www.jimfahad.com that is installed on www.example.com/mysites. Is there any way?
Yes, you can leave the WordPress install and folders in mysites, but you have to copy the .htaccessfile and the index.php file to root. This will result in the visual URL of WordPress being in root (example.com), but the uploads, theme URLs, etc, being in example.com/mysites.
See the WordPress Codex > Giving WordPress Its Own Directory « Using a pre-existing subdirectory install on how to copy and edit the files:
1) Go to the General settings panel.
2) In the box for Site address (URL): change the address to the root
directory's URL. Example: http://example.com
3) Click Save Changes. (Do not worry about the error message and do
not try to see your blog at this point! You will probably get a
message about file not found.)
4) Copy (NOT MOVE!) the index.php and .htaccess files from the
WordPress (wordpress in our example) directory into the root directory
of your site—the latter is probably named something like www or
public_html. The .htaccess file is invisible, so you may have to set
your FTP client to show hidden files. If you are not using pretty
permalinks, then you may not have a .htaccess file. If you are running
WordPress on a Windows (IIS) server and are using pretty permalinks,
you'll have a web.config rather than a .htaccess file in your
WordPress directory.
5) Edit your root directory's index.php:
6) Open your root directory's index.php file in a text editor. Change
the line that says:
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
to the following, using your directory name for the WordPress core
files:
require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );
and save the file.
7) Login to your site (if you aren't still already). The URL should
still be http://example.com/wordpress/wp-admin/
8) If you have set up Permalinks, go to the Permalinks panel and
update your Permalink structure. WordPress will automatically update
your .htaccess file if it has the appropriate file permissions. If
WordPress can't write to your .htaccess file, it will display the new
rewrite rules to you, which you should manually copy into your
.htaccess file (in the same directory as the main index.php file.)

hosting webapplication on wordpress website

i have WordPress installed in the root http://ibdaa.info
what a need to do is to make sub-directory likee: http://ibdaa.info/app and upload my website to this sub-directory its contain (html,css,js)
i make try to just upload my site to previous link but it seem doesn't work
You will have to upload all the files present in the root folder of http://ibdaa.info to http://ibdaa.info/app and then change the site_url and the wordpress_url from the backend to the new url which in case is http://ibdaa.info/app and you will have to change the new url to point to the /app directory in the .htaccess file also.
A similar way would be to define constants in the wp-config.php file with the new url's
define('WP_HOME','http://ibdaa.info/app');
define('WP_SITEURL','http://ibdaa.info/app');

Resources