Correct permalinks and 404-error

This is a common problem (that I just finished fixing). It seems to arise in a few different ways. Some people seem to be able to fix it by selecting the default permalink format and then switching back to their preferred one. In my case, the problem seemed to be that I didn’t have mod-rewrite … Read more

Unable to get /%postname%/ permalinks working, 404 on all links

This is going to sound crazy, but the following worked… I put the content in the following directory: /var/www/myexamplesite.com/public_html (and created log/ as well) Along with the following entry in httpd.conf <VirtualHost *:80> ServerAlias www.myexamplesite.com myexamplesite.com DocumentRoot /var/www/myexamplesite.com/public_html ServerName www.myexamplesite.com # Log file locations LogLevel warn ErrorLog /var/www/myexamplesite.com/log/error.log CustomLog /var/www/myexamplesite.com/log/access.log combined <Directory /var/www/myexamplesite.com/public_html> <IfModule mod_rewrite.c> … Read more

Same base for category and post

Change Category base to . (dot). Nobody knows this trick will work in the future, but there is no easy way to remove /category/ from the URL. So, it’s better to google for a plugin (here is one of them). Yoast’s SEO plugin also is able do the same. Set Permalink structure to /blog/%category%/%postname%/. Then: the_posts_pagination(); … Read more

How to create a front end user profile with a friendly permalink and a 404 trigger

I believe the solution here would be as simple as you’ve generally described it. Assuming conveniently that $wp_query->query_vars[‘user’] contains the username and not its ID: if ( array_key_exists( ‘user’, $wp_query->query_vars ) ) { if ( username_exists( $wp_query->query_vars[‘user’] ) ) { include( TEMPLATEPATH . ‘/user-profile.php’ ); } else { include( TEMPLATEPATH . ‘/404.php’ ); } exit; … Read more