Well, we’d need more information to understand your setup more (contents of htaccess files, how you did have it working, etc), but my general advice would be to stop messing about and pick one or the other. Having multiple URLs is not good for search engines (they see duplicated content and ding you down for it), and it’s not good for your users.
Pick a single location. Get WordPress working there. Leave it there. Don’t try to get all clever on it with several different URLs and such.
To be honest, I don’t know how I had it working. That was my problem; I couldn’t remember how I had set it up.
I’m happy to go with my current set-up henceforth. But there are links out there that refer to the two different URLs.
How would you recommend me to deal with the file not found errors when people go to the URL?
Would it make sense to have a page there explaining what had happened and a redirect after, say, 10 seconds to the main blog page?
Thanks
How would you recommend me to deal with the file not found errors when people go to the URL?
If the URLs are pretty close to compatible, then simply redirect from one to the other using .htaccess files. Something like this:
RewriteRule ^/wp/(.*) http://wp.jeremycherfas.net/$1 [R=301,L]
Thanks. I’ll try that. Just one further question, if you don’t mind. Does that go in the htaccess of the /wp directory? I assume it does, but I want to be sure in case I mess up.
Yes, you’re correct about the location. This assumes that nothing else is in that directory, of course.
I’ve tried as you suggested, and adding that line to the htaccess file, but it didn’t work. Can you help some more?
Here’s the situation:
My blog is at jeremycherfas.net/
WordPress is installed at jeremycherfas.net/wp/
At public_html (which I believe is effectively at jeremycherfas.net) I have this htaccess:
SecFilterEngine On
SecFilterSelective "POST_PAYLOAD" "6x.to" "allow,nolog"
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
At jeremycherfas.net/wp/ I have an almost identical htaccess:
SecFilterEngine On
SecFilterSelective "POST_PAYLOAD" "6x.to" "allow,nolog"
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^/wp/(.*) http://www.jeremycherfas.net/$1 [R=301,L]
RewriteRule . /wp/index.php [L]
</IfModule>
# END WordPress
You can see that I commented out the rewriterule you supplied, because it did not seem to work.
As I understand it, the $1 reference in the rewriterule says add whatever came after the /wp/ to http://www.jeremycherfas.net/ which is exactly what I want it to do. And the [L] means it is the last rule so the next one is skipped anyway.
I tried the same rule in the higher directory and it did not work there either.
All help very gratefully received; I would really like to get this working!
Thanks again.
Ah. Okay, no I assumed that the wp directory was empty. If that’s the actual location, then there’s nothing you can do about it. If you have WordPress in wp then that’s where it is. You actually have to move it somewhere else if you want it to be somewhere else.
What you’ve explained so far is basically a horrific mess. Given that situation, I’d backup the database, scrap WordPress, reinstall from scratch, and restore the database to get everything back. But that’s just me.
Decide what you want to be the case as far as your URLs are concerned and explain what actually *is* the case currently and then you can determine how to get there from here.
The fact that you have two different .htaccess files is also a problem. One of these is unnecessary, the other is incorrect. This is why I call it “a mess”.
I agree that it is a mess, though maybe not horrific. And that is why I want to clean it up.
Thinking more about it, this could be a hosting issue. My host has virtual domains, whereby mydomain.com/blog/ is the same as blog.mydomain.com
That’s certainly what I used to have, operationally, and that is where I want to be again.
So I think I will put everything back as it was and take this up with the hosting company. You may think this is what I should have done in the first place.
Thanks for all your help.
I now suspect it was hosting. I went back in, cleaned up, restored the status quo, and things seem to be operational.
Thanks for the help.