[wp-hackers] redirects for /admin

Dobri dyordan1 at ramapo.edu
Wed Mar 6 18:09:55 UTC 2013


Despite the risk of being ostracized here's my suggestion:

Have a physical file on the server, say admin/index.php (any file that would be treated as index is fine, pick a language)
Have a 301 Moved Permanently in that file
Also don't forget to actually redirect it

Flat files always(?) take precedence over Wordpress so it should be fine. Here's a PHP code sample for the content:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.whatever.com");
exit();
?>

On Wed, 6 Mar 2013, at 12:59 PM, Kirk Wight wrote:

> The redirect is happening through a redirect tool on WP Engine, which I
> thought would be at the server level; I'll dig deeper with them.
> 
> Still, out of curiosity, what is the best way to filter or remove that
> /admin redirect? I'm combing through rewrite.php and filters now.
> 
> On 6 March 2013 12:26, Andrew Nacin <wp at andrewnacin.com> wrote:
> 
>> On Wed, Mar 6, 2013 at 12:21 PM, Kirk Wight <kwight at kwight.ca> wrote:
>> 
>>> Hello,
>>> 
>>> I'm working with a client that needs a redirect in our top level install
>>> directory for /admin, pointing to an external tool. This is causing
>>> problems for anyone logged in, or doing anything at /wp-admin.
>>> 
>>> I'm having trouble finding info on it, but isn't there a built-in
>> WordPress
>>> redirect for /admin that could be causing my problems? What would be the
>>> best way to disable it?
>> 
>> 
>> There is a redirect for /admin built into WordPress, but I doubt it is
>> causing your problem as it happens in PHP. If you do a redirect for /admin
>> at the server level (Apache, nginx), you'll avoid it entirely.
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

~Dobri



More information about the wp-hackers mailing list