Need to edit htaccess while moving on WordPress

This question seems simple, but if you use some of the basic features of WordPress (such as categories), then the solution can become very complex and difficult. My suggestion below assumes that you use a very simple setup. First, I will assume that when you convert your content to WordPress that what you call [pagename] … Read more

htaccess mod_rewrite not working

With some help (also asked on SO, as this wasn’t a strict WP question), and some testing, the following ended up working for me (added a slash just before the $ sign): RewriteRule ^galleries/(.*)/$ /portfolio/$1 [R=301,NC,L] As the galleries are actual directories, not files, they have a slash at the end: http://subdomain.example.com/galleries/headshots/ Here —^

insert_with_markers() WordPress & htaccess 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

.htaccess file changes disappear

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

Installing wordpress on subdirectory 2 levels down

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

Redirect Loop in Regex Moving to HTTPS

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)