Differences if hosted on Windows vs. Linux server? | Peter's Login Redirect | Forum
Back to the login redirect plugin page
10:48 am
Hi Peter,
Hoping you can help. I see you are very active on your forum which is great to see! First, thanks for creating a fantastic plugin. I am creating a customer portal using the directions provided by JTWilcox on the Wordpress forums. He references your Login Redirect plugin as part of the setup.
I downloaded and installed your plugin on a dev blog which is installed on a Linux server with Go Daddy. Plugin worked great, no issues at all. Very easy to use.
I am now installing it on a different server which is where the live site will be hosted, which is a Windows Server 2008 Service Pack 1. When trying to use the plugin, I am getting the following error within Wordpress itself:
****ERROR: Unknown error updating user-specific URL for user abc****
On some of the other posts it seemed that it might have something to do with the rul_type missing all or register but those are both present. I have uninstalled and reinstalled several times. I am now wondering if it is server based? I tried to update the table using the SQL below:
UPDATE `mydatabasename`.`wp_login_redirects`
SET
`rul_type` = {rul_type: ENUM},
`rul_value` = {rul_value: VARCHAR},
`rul_url` = {rul_url: LONGTEXT},
`rul_url_logout` = {rul_url_logout: LONGTEXT},
`rul_order` = {rul_order: INT}
WHERE
But get this message:
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ': ENUM},
`rul_value` = {rul_value: VARCHAR},
`rul_url` = {rul_url: LONGTEXT},
`r' at line 3
I am also getting this message:
Error: `cli3ntr3s0urc3`.`wp_login_redirects`: table data is not editable because there is no primary key defined for the table
Sorry, I know that is a lot! Question is, do you think it is server related? If so, have you run in to it before and have a fix of some kind? Thanks!
Megan Walker
Hi Megan,
I've seen a couple of these types of errors over the years but I could never pinpoint the issue based on the information given and the users never reported back on their solution, unfortunately. The better clue might be the lack of a primary key; you could try to add an "ID" column to the table simply to provide a unique key for the database, in case there's some sort of a requirement for that in your database server.
6:36 am
Hi Peter,
Thanks for the quick response. I am getting somewher… just not quite fixed yet. I added a Primary Key to the rul_value column. I am no longer getting errors when trying to a redirect rule, in fact, I am getting this:
Successfully updated URL for "all other users"
Problem is, the rule doesn't show, and there is nothing in the table in the database. Here is a link to how the table is now set up in the database:
http://bond-us.com/images/redi.....enshot.png
Any thing you think I should have done differently? Made a different column the Primary Key?
Thanks again, hopefully this time if we find the resolution we can actually post it so it will help others! I won't keep it to myself.
Hi, setting "rul_value" as the primary key probably won't work with more than a couple of rules, as the primary key would need to be unique, and that field is often empty. The most reliable single primary key would be to add a completely new field "ID" with an auto increment:
ALTER TABLE `wp_login_redirects` ADD `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
If you're missing the "all" and "register" rules, try to add them through the interface first. If that does not work, try adding them manually:
INSERT INTO `wp_login_redirects` (`rul_type`, `rul_value`, `rul_url`, `rul_url_logout`, `rul_order`) VALUES
('all', '', 'http://localhost/redirecttest', 0),
('register', '', '', '', 0);
10:32 am
Thanks Peter. I walked through the different steps you suggested. I changed the primary key first. That didn't fix it. The "all" and "register" rules already existed. So I then did as you suggested and added my links manually. This was pretty simple using the statement you gave me, and then I also added the a redirect for the role of client which is ultimately what I needed.
INSERT INTO `wp_login_redirects` (`rul_type`, `rul_value`, `rul_url`, `rul_url_logout`, `rul_order`) VALUES
('role', 'client', 'http://localhost.com/clients/variableusername/variable ', '', 0)
Thank you very much for your help with this one! Was frustrating but you helped me out fast! Thanks again!!!