Exclude subfolder from WP-redirect works with html but not php files

I want a certain subfolder excluded from being handled by WP with its 404 – page not found message. My problem is: example.com/Non_WP/myfile.html – shows correctly but example.com/Non_WP/myfile.php – will trigger a WP 404-page not found message. Both files, myfile.html and myfile.php exist in the Non_WP folder. My .htaccess file looks like this: # BEGIN … Read more

Redirect main domain to subdirectory

Following the following code sample I managed to redirect it, however the site URL on the browser show as domain.com/subdirectory and not domain.com. public_html ROOT .htaccess RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?example.com$ RewriteCond %{REQUEST_URI} !^/subdirectory/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /subdirectory/$1 RewriteCond %{HTTP_HOST} ^(www.)?example.com$ RewriteRule ^(/)?$ subdirectory/index.html [L] subdirectory .htaccess # BEGIN WordPress … Read more

Cant get wordpress to work on subdirectory

I have an ubuntu server. I already had nginx and some page there which works. I wanted to add wordpress on /blog path I installed wordpress using this setup https://ubuntu.com/tutorials/install-and-configure-wordpress#1-overview (I didnt start step 7 because i cant get the page to show up) With the setup wordpress lives in /srv/www/wordpress where i see index.php … Read more

How do I get the path of the current executed file in Python?

This may seem like a newbie question, but it is not. Some common approaches don’t work in all cases: sys.argv[0] This means using path = os.path.abspath(os.path.dirname(sys.argv[0])), but this does not work if you are running from another Python script in another directory, and this can happen in real life. __file__ This means using path = … Read more