Redirecting old permalink to new one

RedirectMatch 301 ^/author/$ ^/auteur/$1 This will only redirect /author/, but the target URL is invalid (with a ^ prefix). The target URL is an ordinary string (that accepts placeholders), not a regex. However, since WordPress already uses mod_rewrite directives for the front controller. You should also use mod_rewrite for this redirect (as opposed to a … Read more

Options for restricting access to wp-admin

You could make it a mu-plugin (‘Must Use’ plugin). Any PHP file you put into /wp-content/mu-plugins/ will automatically get included in WordPress. You can’t deactivate the plugin (unless you have ftp access to the server). If you go with a mu-plugin, make sure to put the functionality into a subdirectory and bootstrap it with a … Read more

How to map permalinks with accented letters to sanitized slugs?

The best way to accomplish this is remove the default sanitize_title filter and replace it with yours, which will encode those characters properly. Here is an implementation of using accents in permalinks. Example: remove_filter( ‘sanitize_title’, ‘sanitize_title_with_dashes’); add_filter( ‘sanitize_title’, ‘restore_raw_title’, 9, 3 ); function sweURLtoCHAR($text) { $url=array( “%C3%81″,”%C3%A1”, “%C3%8D”,”%C3%AD” ); $char=array( “Á”,”á”, “Í”,”í” ); $str = … Read more

Htaccess redirect from ‘/%postname%.html’ to ‘/%postname%’

Above the WordPress rewrite rules add: RedirectMatch permanent ^/([^/]+)\.html$ /$1 That will catch example.com/foo.html but not example.com/travel-guides/foo.html. To catch all URLs ending with .html remove the first ^ from the pattern. To redirect all URLs ending with .html except those in travel-guides you need mod_rewrite: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/travel-guides/ RewriteRule ([^/]+)\.html$ /$1 … Read more

WordPress in sub directory wp-admin problem

I think you are missing some rules in your WP .htaccess file. I show mine below. Notice the rules for wp-admin, add them to your file: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /subcataloged/cliens-wp/ RewriteRule ^index\.php$ – [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond … Read more

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