Changing permalinks and redirecting urls

For the first question, you would need a rewrite plugin, as WordPress wouldn’t be able to handle the numbers in that string otherwise (it would see every site as a 404 Not Found), as slugs can’t contain slashes of any kind. Ideally I think your best approach would be to set the post names without … Read more

How to redirect multiple subfolders back to root domain?

This is the solution I finally found after many hours investigation: RewriteRule ^subfolder1/(.*)$ http://www.domain.tld [R=301,NC,L] With the above code in the .htaccess-file, which is located in your websites root directory, all URLs which contain www.domain.tld/subfolder1/* are redirected to the root domain. Hope this will help anybody else than me 🙂

Conditional Redirect

If you want to detect only IE specific browsers, then following code help you. You need to replace the comments with the redirection code function browser_detection_redirect(){ preg_match(‘/MSIE (.*?);/’, $_SERVER[‘HTTP_USER_AGENT’], $matches); if (count($matches)>1){ //Then we’re using IE $version = $matches[1]; switch(true){ case ($version<=8): //IE 8 or under! break; case ($version==9): //IE9! break; default: //You get the … Read more

redirect “about author” code to about page

Use get_userdata() to retrieve all user data. The function accepts user ID. So the following code will give you the user url. <?php php $user_info = get_userdata(1); /* replace 1 with dynamic user id variable in your context*/ echo ‘User url: ‘ . $user_info->user_url . “\n”; echo ‘Users name: ‘ . $user_info->first_name . “\n”; ?>

HTTPS to HTTP rewrite rules not working as expected

The SSL admin and login redirection should be done through the FORCE_SSL_ADMIN constant in wp-config.php: define(‘FORCE_SSL_ADMIN’, true); For further information: Administration Over SSL Aditionally, if you want be redirected to http when you’re logged and in the frontend, take a look at: Redirect WordPress front end https URLs to http without a plugin

Missing domain http://./wp-… in redirects

Possible solution: * go to permalinks under settings and check URL structure with your desired domain name. Even if the URL seems to be right, click the desired structure and save. This was handy while i migrated 2 websites. or * look for “wp_options” table in your database. You will find “siteurl” & “baseurl” row. … Read more