I have a Wordpress site with permalinks set to /%category%/%postname%.html. When I visit to a non-existing page, let say, example.com/non-existing-post, Wordpress 301-redirects to homepage instead of showing the 404.php page, which is inside the theme's package. Below is the htaccess code;
AuthName "protect"
AuthUserFile "/home/sitename/.htpasswds/public_html/passwd"
suPHP_ConfigPath /home/sitename/public_html/
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
When I tried to disable custom permalink structures, it returns a error 404 but not with 404.php page that I preferred(normal Apache error, I guess).
There have been a lot of similar discussions about this "bug", please see the links below. All of them not seem to be resolved. :(
http://wordpress.org/support/topic/404-pages-not-working-1
http://wordpress.org/support/topic/404-pages-not-working
What's causing Wordpress automatically 301-redirect a page that is supposed to show 404 error?
UPDATE(Feb 21, 2013) - Problem's still persistent. I think it's a bug in the wordpress core that involves in "pretty permalinks" redirections.
Still I'd like to solve this problem since I've got a handful of Wordpress sites that have this and I think other people are experiencing the same bug in their sites.
Related
I'm having major issues with my local development version of a client's site.
I've been working on their blog section and began getting 404 errors when using the pagination links for categories, or posts by author.
After doing some research the most common solution seemed to be to go to WP Admin Area and reset the permalink settings. So I did that, and that is where the fun really began.
Now, none of the nav menu items work at all. If I click any of them I get a 404 error - although they don't render the 404.php file, just a generic page with "NOT FOUND The requested URL /Clients/blah-blah-blah/index.php was not found on this server."
Looking further into it the most recommended course of action is to amend the .htaccess file, which I have, but to no avail.
At present, the .htacess file has:
**ErrorDocument 404 /404.php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /Clients/Bubs%20World%20Dev/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /Clients/Bubs%20World%20Dev/index.php [L]
</IfModule>
# END WordPress**
I've tried other solutions along the same lines but they don't seem to work.
If anyone has any ideas on this it would be greatly appreciated.
Thanks in advance,
Don
I am trying to redesign a website from a friend and it's chaotic as hell. Now I am stuck a bit.
The old domain it something like http://www.website.com/folder/
I am trying the get rid out of the "folder", so I changed the setting in the wordpress setting and the root in the web-provider. The whole website is working fine, also the Wordpress admin area. But if I'm trying to get into the "home" page, it won't load - or it is loading endlessly.
Do you have any idea how I could fix it?
Regards and thanks,
Natts
A piece often forgotten is the .htaccess file (found in the root of your WP install); I especially suspect it because you're going from a subfolder to no subfolder.
Back it up, then override it with the default WordPress values (or delete it and go to Settings -> Permalinks in WP Admin)
Default .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I have problem with images on my website. I have installed wordpress in blog directory, co I could access my website like mysite.com/blog. I have followed tutorial on this page Giving_WordPress_Its_Own_Directory (Using a pre-existing subdirectory install), to redirect it, so I have changed site address url in settings to mysite.com, add index.php to root and add /blog/wp-blog-header.php in this fileā¦ I also have to update permalinks and htaccess copy to root, with following code
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Now my website is working fine but images are not working. I can see them but after click on them it shows 404 error page. There is /blog/ in image url. If I remove blog from url manually, it shows page with image (lightbox is not working) Could somebody help me how to solve this? thanks
I'd try Better Search Replace plugin to change urls of images in database.
I am working on the site: http://cancerhope.com/
If you go to the home page it works but if you click on any of the links it doesn't. It did work before but I had a nameserver issue that I resolved last Friday. I have tried various permalink settings (default, postname, date, etc.) It is currently set to postname but none of the pages work and I am not getting any errors in my console. I have tried turning off the plugins to no avail.
Here is a page that shows up blank: http://cancerhope.com/consultation/
I have tried deactivating all the plugins and changing the theme to a standard WP theme. I have deleted the htaccess file and reset the permalinks to default as well as postname and other settings. I even deleted the htaccess file between these changes.
Current htaccess code is:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Nothing seems to work.
Strange thing is that the blog page works:
http://cancerhope.com/blog-2/
The actual article that we have there works to:
http://cancerhope.com/2015/08/welcome-to-cancerhope/
Any suggestions?
Hello community i came up with a strange problem and i think it's the .htacces causing the problem. I run a WORDPRESS site and i check it with a SEO toolkit (Microsoft).
When the report finishes it come up with some violations:
"The link to "http://www.example.com/?p=11" has resulted in HTTP redirection to "http://www.example.com/example/".
-I activated permalinks inside wordpress.
-I using SEO by yoast plugin.
-My .htaccess file is:
`# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress`
Any idea how can i remove invalid redirections ?
Thanks all !
If the official url of your web page is www.example.com/example/, than ideally the user will never see a page "www.example.com/?p=11" . So the redirect is not bad in this case. It may even be good, so that google knows which of theses urls should be the one it should index.
It is only bad if you still have links somewhere that still have the form "www.example.com?p=11". But than these links are the problem, not the redirect.