Wordpress: Permalinks for pages broken - wordpress

I'm using Wordpress 3.1.1 and recently reorganized my page (deleted and moved a lot of pages). Now I get 404-errors when accessing some pages (all posts and tags work fine).
I can disable the permalinks and then access all pages without problems. I can also rename the pages (e.g. contact --> contact1) and all links work again for the new names. However, if I rename them back, I get the same 404 error again. It seems like some kind of caching-problem. Any ideas how to fix it? Thanks!
My .htaccess for the root directory:
# 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

Try clearing your 'trash' can in Wordpress, annoyingly items in the trash area still use a permalink, and when accessing those links you'd get 404 message.
Also delete your htaccess file (if it has no additional settings in it), and the reset your permalink settings.
Ian.

I finally solved it. I realized, that there were some page names, that produced a server 404 and some, that don't. Then I took a closer look at my directory structure:
I access my blog from the root path (not the worpdrpess-directory which is located in it). So I can enter
www.myurl.com
instead of
www.myurl.com/wordpress
So far, so good. However, I had some files in my root directory, that had the same name as the page I was trying to access.
Eg. if there is a contact.abc (the extension doesn't matter) in the root folder, then getting
www.myurl.com/contact
will produce a 404-error. If I rename the file everything works fine. Hopefully, that will help others as well.

Related

404 Error WordPress

I am trying to open my website but it keeps giving me a 404 error. I checked multiple sources and tried different solutions to solve the error, for example, I have tried:
permalinks changes
.htaccess file current code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>)**
However, the problem still exists. Also, after doing the desired changes now I am getting the following error:
This page isn’t working paracha.tech redirected you too many times.
Try clearing your cookies. ERR_TOO_MANY_REDIRECTS
Let me know if anyone can help.
Thanks
I was also facing a similar problem but I solved it with the help of these simple steps.
Go to Settings > General and click Save Changes.
Go to Settings > Permalinks and click on save changes
Go to Settings > General and check what you have for Site Address and WordPress Address. The site address should be where you want the front end of the site to be, and the WordPress address is where your WordPress files live.
Based on the htaccess code you posted, it sounds like both of these settings should be your regular domain name without anything changed.
Also, sometimes after making these changes, you have to flush your permalinks settings. So, go to Settings > Permalinks and just click the Save Changes button again.

WordPress Home Folder (Default) Issue

I've recently relocated a WordPress site to a new host. I followed the instructions from here and things seemed to go ok. However on the old host the installation was inside a sub-folder (news). On the new host I want it in the public_html folder. All files are up, I have made the appropriate changes to the wp_config file, I have edited the .htaccess file and removed any references to the old path, I have even gone into the wp_options table and made the url changes there.
However for some reason whenever I reference the index.php, it tries to point back to the old sub-folder location. I've looked in the wp-settings, wp-load files etc and for the life of me cannot find where the bad path information is.
I've gone to the wordpress.org site and several other sites, any help would be appreciated.
UPDATE: I deleted my wp_config file and the system asked me to setup, so I did. During the setup it recognized that the database was there, etc, and sent me to the login. I was able to login, looked at the settings, etc and they are all as they are supposed to be.
If I go directly to wp-admin or wp-login it lets me log in with no problem. however when I try to go to the site, nothing, however instead of showing the old url, it now shows a blank screen.
Thanks
First of all make sure that your whole database does not contain any references to the old installation otherwise some redirection may be active. For migrating your database nowadays you use the following tool to make sure that also serialized data does not contain any references to the old URL:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Can you reach your backend? If only the frontend does not work its probably a permalink problem update your permalinks by going to Settings -> Permalinks -> Save (Update)
Check your index.php and the index.php file from the main directory and also from the subdirectory if there any redirection is active
Do a search (and replace) for the content of all files within your WordPress installation and check for any possible hardcoded redirection
It MUST be one of those problems.
If still no success debug your WordPress installation step-by-step (with echo "reached"; die;) to find out WHEN the redirection is happening - important points to check:
index.php file
wp-config.php file
Action Hook 'init'
Action Hook 'template_redirect'
This might also be helpful: http://rachievee.com/the-wordpress-hooks-firing-sequence/
Check your .htaccess file.
You probably have something that looks like this(notice the subfolder):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subfolder/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subfolder/index.php [L]
</IfModule>
# END WordPress
When you should actually have something that looks like this:
# 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
First although neither of the two posted answers solved the problem, they both were instrumental in helping me figure out what was wrong, so I voted each of them up.
Since I could log into the admin area, I knew things were pointing to the correct place. But I was still getting a blank page, well it turns out that somehow in the ftp transfer of the backup site to the server, the 'themes' folder didn't make it. Once I uploaded that folder, things are close to being back to normal.
Again, the advice I received helped me tremendously in troubleshooting this sucker. Thanks

Error 404 not going after Wordpress Permalink change to custom structure

I am having a lot of problem because error 404 is not going. I have changed the permalinks to /%postname%/ . Since then I am getting 404 when I try to move to any page other than "Home". Home works fine.
Website : http://www.jitechnologies.com (The website is built by a non-professional, so please ignore the design for now). Website is hosted and the hosting company does not allow me to edit the web.config file. So please suggest your resolution accordingly.
I have checked the .htaccess code several times and here it is for your reference:
# 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 removed all plug-ins.
I changed the permalink structure to "Default" then everything works perfectly. but, /%postname%/ again I start getting 404 Errors.
Is there something I am missing out. I request some technical help for this resolution.
Thanks in advance.
I had this same problem before and it was because I didn't upload wordpress to the root folder of my domain. Make sure it is. If that doesn't work, clear the cookies in your browser. If that doesn't work, create a backup of your database through your cPanel and then re-install Wordpress making sure it is in the correct root folder on your domain. Without seeing everything you are talking about, it is hard to say for sure, but I am sure it doesn't have anything to do with your web.config file.
If you do all of these things and re-install wordpress, it should work just fine. Again, this sounds like the exact same thing that happened to me about a year ago, so give it a try. If that doesn't work it must be your permissions.. Check the 'all permissions' box when you create your new database from your cPanel if everything else has still failed. This means you will be starting from scratch essentially, but wordpress has so many good features, this shouldn't be such a terrible thing.

Wordpress installed in root folder, subdomain now not working, GoDaddy host

please forgive me for being a complete beginner at this, I'd rather not have to try to deal with this myself but as GoDaddy support have not replied after 2 days I'm going to have to. I think my problem is the same as the one above, but I'm not 100% sure, so I'm reposting it, I'm not really confident enough to attempt to try the fixes I've seen here so I need someone to give me baby instructions?
Our original website (www.mwpics.com.au) was built in Dreamweaver etc, recently we created a new website in Wordpress, in a subdomain, then migrated it over to the root folder where it is now operating fine. I also moved the files for the old website into another directory which I called 'old', so they're all still there.
The problem is that I have a subdomain set up - which is still showing as set up in the control panel on godaddy the url is www.mwpics.com.au/clients and it is at www.clients.mwpics.com.au. This directory contains loads of other directories, each of which is password protected by .htaccess files and which our clients access directly (not through the site) to download their finished work. The test one and the one for random clients is www.mwpics.com.au/clients/temp - username and password both temp (the usernames are all the same as the directory names).
Since the WP install to the root directory the /clients extension no longer works (it should bring up an information page which is an .html index page in the directory) and the /clients/name extensions no longer works - it goes back to the wp site with a 'not found' error message. Strangely it does bring up the box for the username and password, but when you enter it it just goes back to the 'not found' message.
Someone told me it was the .htaccess file - so as an experiment, I renamed the .htaccess file in the root directory and then copied the .htaccess file from the old root files into the root directory, eureka! It worked - and also the WP site opened to the home page... but bummer - the /pages in the WP site now no longer worked! But at least I know the source of the problem.
So I switched it back and this is the status quo - I have no idea how to fix this, and with everyone back at work tomorrow, clients are going to want to start downloading their stuff...
Can anyone help me? I'm starting to panic a bit
you only have to exclude the clients subfolder in your wordpress .htaccess - see .htaccess & Wordpress: Exclude folder from RewriteRule for a detailed description
this should work:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/clients.*
RewriteCond %{SERVER_NAME} !clients\.yourdomain\.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
short: it simply skips the wordpress rewrite rule if the reqest uri starts with /clients or the domain name is clients.yourdomain.com
be aware though, that as soon as you update your wordpress permalink settings, this rule will be overwritten by wordpress ...
Try adding the following at the top of your root directory's .htaccess file, before the WP code block:
<IfModule mod_rewrite.c>
# fix rewrite for GoDaddy
Options -Multiviews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} clients.mwpics.com.au$ [NC,OR] # ignore subdomain
RewriteCond %{REQUEST_FILENAME} -d [NC] # ignore directories
RewriteRule .* - [L]
</IfModule>

Problem with Wordpress permalinks and mod_rewriter

first off...thank you so much for your time.
I was referred to you guys and heard here's the best place to find a solution.
Ok...so here's the problem.
My old programmer set up the wordpress permalinks to be dynamic, but we all know that they are the worst to pull in traffic from search engines (specially google).
So I need an expert to set it to custom structure, which will show the words on the title on the URL or "URL friendly links" if you may.
I have some knowledge of computers/programming myself and so I tried to log in on our site's wordpress admin page, and change the permalinks to "custom structure": /%category%/%postname%/
Then also add the word : "categories" on the "category base" and "tag" on "tag base".
What happens however is that when we change that the url links are successfully changed, however...evertime you click on a category link, it takes you back to the main page of the site (instead of the category you chose). That also happens when you click on the pages menu on the site (at the bottom of the pages. ex: 1,2,3,4,5...) it doesn't take you to those pages instead, back to the main pages.
I think it's something that was done to the theme of the actual wodrpress, instead of the FTP, etc...
It might be something simple and fast, but I just can't seem to do it myself.
Edited to add:
By the way...forgot to mention. I already added this to my htaccess. file
RewriteEngine on
ErrorDocument 404 /404.shtml
# BEGIN WordPress
# END WordPress
RewriteCond %{HTTP_HOST} ^thehypebr.uol.virgula.com.br$ [OR]
RewriteCond %{HTTP_HOST} ^www.thehypebr.uol.virgula.com.br$
RewriteRule ^/?$ "http\:\/\/thehypebr\.com" [R=301,L]
then i deleted it all and only have:
# BEGIN WordPress
# END WordPress
Looks like the rewrite rules necessary for pretty urls were not added to your .htaccess files like they were supposed to (as you can see, the wordpress part is empty but it should not be).
Maybe the permissions on .htaccess were too tight. Try setting the permissions on your .htaccess file to be world-writable. Then switch back to dynamic urls, then back to custom structure. Theoretically, if permissions were the problem, wordpress will fill in the rules now. And then you can set the permissions on .htaccess back to normal.
When you log into the backend of Wordpress and go to your permalinks section try hitting the save button again. Once the page refreshes saying it saved it, scroll to the bottom of the page and there should be a paragraph telling you what the .htaccess file should have in it. ( It is usally a grey or yellow background paragraph ) Copy that and paste it into your .htaccess file instead of what you have now. This should help add the correct rules.
It usually looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Resources