Redirects the user to a specified absolute URI.

learn more… | top users | synonyms

0
votes
2answers
783 views

Question about proper use of wp_redirect?

I'm attempting to create a Twitter style stream, so basically just index, a tag archive, and maybe a page or two while prohibiting access to everything else. For instance, they try to access a single ...
1
vote
1answer
2k views

wp_redirect not working in header, exit is breaking page

Sorry to ask such a basic question, I've looked at other questions and not found an answer. I've customized some public pages with their own header-public.php, and I'm doing a basic login check for ...
1
vote
1answer
1k views

Controller functionality - if user is not logged in send them to specific page (not wp_login)

This sounds dead bang simple, but I just can't figure it out. I want the following functionality: If user is not logged in and they try to access anywhere on the site (including the homepage) - send ...
2
votes
2answers
1k views

Action wp_login_failed not working if only one field is filled out

I created a login form in the frontend with wp_login_form(). In my functions.php file I added an action to prevent the redirect to /wp-login.php if the login failed with ...
0
votes
1answer
205 views

Cannot get redirect working

I can't get wp_redirect working correctly? I thought I'd figured this out (see wp_redirect not working when going to www version of site) but apparently not; no idea what changed between last week ...
3
votes
1answer
1k views

redirect out of wp-admin, without losing admin-ajax.php

I'm trying to keep all non-administrators out of the Wordpress admin panel by using a wp_redirect inside of an is_admin conditional. The problem is that a side effect of this if that non-admins can no ...
-2
votes
1answer
86 views

How is WordPress redirecting/rewriting my URL?

i'm running a wordpress free classified website and the address is http://www.gosell.co.uk what i need is if a user from london open this url then it should be concatenated with ...
2
votes
1answer
359 views

Can't get rewrite rules working

Basically I want to rewrite: /edit/test-post to an existing page with a parameter: /edit?e=test-post From the examples in the Codex I created: add_filter( ...
0
votes
1answer
380 views

wp_redirect not working when going to www version of site

The following function works perfectly when logged-in visitors go to http://sitename.com, taking them to the site homepage. When logged-in visitors go to http://www.sitename.com, however, they're ...
0
votes
2answers
3k views

Checking if a user is logged in, if so redirect to a different page

I'm making a member-only site that requires users to be logged in to use the site. The homepage is publicly viewable. On the homepage, I'd like to put in a function to redirect users to a page inside ...
-1
votes
1answer
149 views

problem redirecting users to page on login

I'm trying to redirect certain users to a part of my site but I cannot seem to make it work... can you take a look at this and tell me what I'm doing wrong? if ( ! function_exists( ...
0
votes
1answer
340 views

Load template inside a parent template

Inside of my current theme directory, I created a folder called "mobile" which contains a separate set of template files, all optimized for mobile. Now, say I setup a function that detects a mobile ...
0
votes
1answer
186 views

Does WordPress send a 301 header message when you change permalink structures?

I have a super old blog that I upgraded from 2.0.7 to 3.1 by upgrading over multiple versions. One of my biggest concerns was losing all the link juice from my legacy URLs but they were clearly made ...
1
vote
1answer
801 views

Can I change default registration link (without htaccess)?

I'm using url like «wp-login.php?action=register&role=patient» and «register_form» hook for add extra inputs form which depends on urls like this: ...
0
votes
1answer
196 views

Error messages when adding code to function.php or trying to delete inactive plugin files

Error message below: Warning: Cannot modify header information - headers already sent by (output started at /home/content/79/7603579/html/listings/wp-content/themes/OIB theme/functions.php:519) in ...
6
votes
1answer
2k views

Pretty permalinks for search results with extra query var

I'd like to know how I can rewrite a search URL that also contains an extra query var into a pretty permalink using wp_redirect and the template_redirect hook. I have taken the code from the Nice ...
0
votes
1answer
874 views

Redirecting to a post based on a GET parameter and a custom field

I'm trying to redirect to a specific post based on a GET parameter. The value of the GET parameter is the value of a specific custom field. For example: http://somedomain.com/wordpress/?fid=xyzzy ...
0
votes
2answers
292 views

Redirecting simple big problem

i'm a little worried here. I'm trying to redirect EVERYONE that access my site to a specific webpage, and nothing is working! Currently i'm trying this code: function redirect_this() { ...
2
votes
1answer
2k views

How to hide/redirect the author page

I have a website where I let people subscribe. I would like to only show the author page for actual authors who have written a post. I wrote this code that checks for post the problem is I can't use a ...
4
votes
2answers
1k views

Why is wp_redirect() preferable to a standard PHP header redirect?

In asking a question about hooks and redirects, I was advised to use wp_redirect in place of the PHP header function. Just wondering why wp_redirect is preferable?
2
votes
3answers
2k views

How to 301 private posts rather than 404?

How do I 301 redirect private pages, rather than 404 them? If a post is private, WordPress filters it out in the SQL query, so there are no $post variables to work with. I'd like for this code to ...
0
votes
1answer
302 views

Date based redirects of posts that no longer exist

I want a more elegant way to express the following redirect: RewriteCond %{REQUEST_URI} ^/blog/2008/(.*) [NC, OR] RewriteCond %{REQUEST_URI} ^/blog/2009/01/(.*) [NC, OR] RewriteCond %{REQUEST_URI} ...
3
votes
4answers
813 views

Using a Theme inside a Plugin directory

I am building a mobile friendly plugin and put the theme directory inside the plugin directory. If it's a mobile browser, how can I redirect to the theme in the plugin directory? ...