Redirect to dashboard after login

The second input argument $request, in your app_login_redirect() callback function, takes it’s value from source: isset( $_REQUEST[‘redirect_to’] ) ? $_REQUEST[‘redirect_to’] : ”; so if I understand you correctly, you could just check if it’s empty or not, if you need to know that within your logic parts.

Why am I getting a 301 on a existing post?

After pretty much destroying the website (copy) I found the answer, but I am not 100% sure of the cause. WordPress saves the name of old posts slugs, so that it can create 301 redirects. It adds an entry to the postmeta table called _wp_old_slug. I had over 110 entries on my postmeta table with … Read more

How to configure nginx to redirect requests to the uploads directory to the production server?

You could try something like this: server { root /srv/www/example/htdocs; index index.php; # Matches any URL containing /wp-content/uploads/ location ~ “^(.*)/wp-content/uploads/(.*)$” { try_files $uri @prod_serv; } # Will redirect requests to your production server location @prod_serv { rewrite “^(.*)/wp-content/uploads/(.*)$” “http://yourdomain.com/m/wp-content/uploads/$2” redirect; } # The rest of your location blocks… location /m { index index.php; try_files … Read more

WordPress install enters an infinite loop

I finally found a solution to this problem and thought I would post my solution for anyone looking for assistance. My main website sits on /public_html on my server I was installing new sites on a subdomain (e.g. newwebsite.com.au) in a sub-directory: /public_html/sites/newwebsite.com.au Even though /public_html/sites/newwebsite.com.au was the root directory for the subdomain: newwebsite.com.au for … Read more

Prevent access to single post types

The fast way In your .htaccess add a rule RedirectMatch Permanent ^/press/.+ /press/ Plugin way Hook into template_redirect and redirect all requests to a single entry: add_action( ‘template_redirect’, ‘wpse_45164_redirect_press’ ); function wpse_45164_redirect_press() { if ( ! is_singular( ‘press’ ) ) return; wp_redirect( get_post_type_archive_link( ‘press’ ), 301 ); exit; } (Caveat: not tested)

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