I can access subdirectory, but not files within it
Turns out the file was the problem, as @TheDeadMedic suspected. The permissions were 640. After changing them to 644, the problem was solved! Thanks for the help.
Turns out the file was the problem, as @TheDeadMedic suspected. The permissions were 640. After changing them to 644, the problem was solved! Thanks for the help.
I would suggest an alternative route: the rewrite API – did you know it supports external URLs*? function wpse_199898_add_htaccess_rule() { // No need for the caret “starts with”, WP will add it add_rewrite_rule( ‘article/([/_0-9a-zA-Z-]+)$’, ‘http://www.domain.tld/?id=$1 [R=301,L,NC]’ ); } add_action( ‘init’, ‘wpse_199898_add_htaccess_rule’ ); *Almost. We just need a fix for WP’s quirky path prefixing: function wpse_199898_fix_htaccess_rule( … Read more
The way the wordpress htaccess works is that first it looks if there is a file matching the request location, in which case it is being “run”, otherwise the wordpress handles the URl. Basically you don’t even “execute” your subdirectory’s htaccess unless you access an existing fie there. What you should do is to add … Read more
I was having a similar problem recently. It turned out it was due to a code injection in the /wp-includes/nav-menus.php file. There was a Base64 malware code injected that was causing my .htacess file to chmod itself to 444. Something called some kind of darkleech malware. See this link for more, maybe it’s what’s happening … Read more
I have found a response on a forum which suggests that the only way of acheiving this is to create a subdomain for the folder which is to be protected, this works fine. Regards
I managed to resolve this myself. Apologies for wasting anyones time. The fix was simple. I just had to add the following piece of code to my .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /jack/blog/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /jack/blog/index.php [L] </IfModule> Save my permalinks and the problem … Read more
RESOLVED: This issue came about from many warnings in Bing Webmaster Tools. I discovered that I had added these sites to “My Sites” before I moved them over to HTTPS. I had to delete the sites from BWT and add them back again. It now shows that they’re being crawled correctly. Another coder over at … Read more
What happens when you visit /wp-login.php ? Is the .htaccess itself set with proper permissions? My wp-content, wp-admin, and wp-includes all have rwxr-xr-x / 0755 and my wp-login.php, .htaccess all are rw-r–r– / 0644 Is this a fresh install? You can also check the server logs and the last resort, but perhaps the easiest, contact … Read more
Targeting .htaccess file with file_put_contents
Try this: <IfModule mod_rewrite.c> RewriteCond %{HTTP_HOST} ^www\.mydomain\.com [NC] RewriteRule ^(.*)$ http://mydomain/.cl/c/news/.com/$1 [L,R=301] </IfModule>