Redirect to my blog site address

Web hosting discussion, programming, and shared and dedicated servers.
17 posts Page 1 of 2
by bob noble » Sun Jan 08, 2017 3:17 pm
Hi,
Before my site got attacked the first time, the address bnoble.users.sonic.net/wordpress/ was used by a lot of people to get to my site. After we got the site going again, that no longer worked and only www.bobseyes.net worked and bobseyes.net.

So, either you guys at sonic.net changed something, or it just got broken. I'd like to get it so the bnoble.users.sonic.net/wordpress/ address points back to bobseyes.net.
Is that something you can do for me, or something I can add to the .htaccess file? If so, what do I need to add and where in the file?
If you think that is a bad idea for some reason let me know. Some of my readers seem to be trying to still access my page through that channel and also the search engines still send people to that address.
Thanks,
Bob
by drew.phillips » Mon Jan 09, 2017 12:29 pm
Hi Bob,

This is happening because the "Site URL" option in WordPress was changed from bnoble.users.sonic.net to bobseyes.net/, but in our system both of those URL's point to the same thing.

Now, when someone comes in on /wordpress/, WordPress is trying to parse the URL and thinks the post/page name is "wordpress" (due to /wordpress/ in the URI), which it then looks up in your database and doesn't find so it shows the 404 page.

I added the following lines to your .htaccess file which seems to properly handle redirecting from the old version (including any existing links).

Code: Select all

RewriteEngine On
RewriteCond "%{HTTP_HOST}" "bnoble.users.sonic.net"
RewriteRule "^/?(.*)" "http://bobseyes.net/$1" [L,R=301]
For example, going to http://bnoble.users.sonic.net/wordpress/about/ will redirect to http://bobseyes.net/about/

Please let me know if you find any issues with this change.

If it doesn't work out, we can take a simpler route and use .htaccess to just blanket redirect from /wordpress/ to your home page, but this wouldn't preserve old links - just forward to the new URL.
Drew Phillips
Programmer / System Operations, Sonic.net
by bob noble » Mon Jan 09, 2017 11:23 pm
Hi Drew,
When I tried to publish to my blog tonight with Live Writer, I got a login error, so I tried to go there with my wordpress dashboard and got a strange login window, one I hadn't seen before. It wasn't the regular wordpress login so I wasn't sure about another hack. But after checking some things out with Filezilla on my site I decided I'd give the login a try and it wouldn't accept my password. And even worse, it wouldn't email a new password form. So I did some looking around and tried this and that without too much luck. I at least decided my site wasn't likely hacked as I couldn't see any real damage, even if I couldn't get in.
Then I decided to check out this forum for reply's on my latest topic, this, and saw where you'd been working on my .htaccess file for me and eventually I thought maybe that might be somehow causing the login problem, which was easy to check.
So, I renamed your .htaccess file .htaccessdrew and put the older one back in and I was able to have the password form send me a reset password form and all was good. It might be my old password might have worked, I can't remember if I checked.
Anyway, for some reason the redirect is confusing something?

Let me recap the redirect situation:
In the beginning I was using my free web hosting for Wordpress at this url, I believe: bnoble.users.sonic.net/wordpress, at least I think. :O)
Eventually I ran out of space and had to get a value hosted site with bobseyes.net and most of my readers where still coming to my new site using bnoble.users.sonic.net/wordpress/.
Now something was wrong, maybe something I did that would only let me use bnoble.users.sonic.net/wordpress address in Wordpress or wordpress wouldn't work. in other words, bobseyes.net wouldn't work at that time inside wordpress, until you fixed me up when I first got hacked. Of course I dumped a bunch of new wordpress files in there too, so I'm not sure what happened at that time.
So right now, bnoble.users.sonic.net points to my old website in my root, and bnoble.users.sonic.net/wordpress goes to a file not found in my blog, instead of the main blob page.
So, the problem is I still have a bunch of people trying to access my site at bnoble.users.sonic.net/wordpress and there is still a lot of search engine traffic sending people to those pages which get a page not found.
I think in time it will all get resolved, but It would help on the short term if those people weren't finding file not found.
This has only been a problem since we fixed the first hack, but things were set up wrong from the beginning and I knew that now they were likely as they should of been from the beginning.
So, I've been thinking about it and decided maybe I should try to do some kind of redirect if it wasn't too hard to pull off.
So, if we can do something, good. If not, I think it will all work out in time.
Thanks for your help,
Bob
by bob noble » Tue Jan 10, 2017 12:09 am
Hi Drew,
It appears it's not something you did as I'm still having some login problems.
I'm getting a strange login window that isn't the usual wordpress login window, but it does take me to wordpress and it will email a reset form once I removed your code.
But, even with your code removed I still get the strange login window that won't let me in my site unless I use the reset password email form which it emails to me as long as your code isn't there.
But then I go off my dashboard and then try to go back in and that strange login window is there. I enter my password and it takes me to webpage not found with the address window reading;
http://bnoble.users.sonic.net/wordpress ... p-admin%2F
However I know the password is good and is getting changed as my Live Writer will post with the new password. I've disabled all my plugins except wordfence.
Any ideas on this one?
Thanks,
Bob
by drew.phillips » Tue Jan 10, 2017 12:16 am
Something odd is going on, when I view the source of various pages, some URLs refer to bobseyes.net, and many to bnoble.users.sonic.net.

If you were able to log in, do both your site URL and blog URL in general settings point to bobseyes.net? If not, they should.

The login page I got looks normal, but its trying to actually login at the sonic.net URL and not your domain which would be problematic with the .htaccess I put in place.

I can look further in the morning if that wasn't it.
Drew Phillips
Programmer / System Operations, Sonic.net
by bob noble » Tue Jan 10, 2017 1:09 am
Hi Drew,
The general page has the url for wordpress set to bnoble.users.sonic.net/ wordpress and it's grayed out and I cannot change it. the website url is bobseyes.net.

Maybe a reinstall would give me the chance to change that, or it might find it automaticly. :O)

On another note, I was replacing wordpress file and directories with the .snapshot stuff and I can usually not locate the weekly snapshot. I used one day stuff, ,but it was after midnight so it might be the same as the day before? Where are you hiding the weekly one. I know it's there as I've used it before, or is it just updating since it's around midnight and hidden?
Thanks again for the help. In some ways it's interesting and I am learning some stuff. :O)
Bob
by bob noble » Wed Jan 11, 2017 7:34 pm
Hi Drew,
Appreciate you fixing up my login before heading home last night. :O) It's just nice when things work as they should.
I'm wondering if the two addresses in my Wordpress are causing some problems, instead of just being bobseyes.net? I notice all the other sites I saw on YouTube all have only the one. Mine is grayed out, so I can't easily change it. Maybe a fresh install would fix that, but was wondering what you think on that subject?
Thanks again,
Bob
by drew.phillips » Thu Jan 12, 2017 9:30 am
Hi Bob,

I don't think the two addresses really help anything so it's better to get them set to what it actually is (bobseyes.net) and go from there.

It turns out, that option was disabled in wp-admin because the wp-config.php file had:

Code: Select all

define('WP_SITEURL', 'http://bnoble.users.sonic.net/wordpress');
I commented out that definition and updated the value in the database to match your Blog URL. Things seem to load a little better now and the URLs I see in the HTML output are all correct.

It looks like there might be some hard links to bnoble.users.sonic.net in some posts/pages, but the links and images load, so I wouldn't worry about fixing them right away.

This seems like a step in the right direction at least. How do things look on your end now?
Drew Phillips
Programmer / System Operations, Sonic.net
by bob noble » Thu Jan 12, 2017 9:21 pm
Hi Drew,
I checked everything out I could think of and did a post with Live Writer and I'd say everything is working real good. :O)
The login window is a little different in that admin is already in the window and I have to click in password to bring up the stored one, but that's ok and so far it's the only thing I've noticed different, besides things just seem to be working faster, but maybe that's just me.
Thanks for that.
Two things.
I'd still like to change the admin user name, but it's greyed out and says username can't be changed on the right.
I saw a guy change it during the install for the same reason, on YouTube, that you gave . But now it's locked grey and so far the only way I know change that is use the installer, but not sure how to get it to work? Maybe something I shouldn't mess with as Word fence seems to be doing a good job. Interesting the guys trying to get in started using the name test today.

The second thing, is it ok if I put the redirect back in .htaccess to see how it works now, or will it mess up the login, not that it did before as I don't know, but I'll give it a try if it's ok?
Ok, I feel were making some good progress and my site is working better and hopefully protected from the bad guys. At least I know it is better now than before.
Thanks again for your help,
Bob
by drew.phillips » Fri Jan 13, 2017 10:02 am
I think the only way to change the "admin" username is to change it in the database (either with a plugin or manually) or create a new user and copy everything to it. This page outlines the 3 different ways. phpMyAdmin is maybe the quickest, or going the plugin route would also work.

The autocompleted fields on the login form are probably working differently since the URL has now changed so it's either picking up settings that had been saved a while back, or it's no longer recognizing your saved password and just needs to be updated.

Now that it sounds like things are dialed in pretty well, trying the .htaccess redirection again sounds like a good idea. I think everything is working to the point we can safely redirect the old URL's. The only thing that it may affect are posts that have hard links to the old site address. If you notice some images broken after the change, that'd explain it. Then, we could either remove the .htaccess or you can go through your posts, identify which ones are pointing at the old address, and edit them to reflect the new URL.

Hope that helps Bob!
Drew Phillips
Programmer / System Operations, Sonic.net
17 posts Page 1 of 2

Who is online

In total there are 26 users online :: 0 registered, 0 hidden and 26 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 26 guests