New WordPress install? First thing to do, setup permalinking!

I had to learn the hard way – my permalinking troubles continue. On any given day, some of my closest friends will visit a website I have worked on and find one broken image or link, and start to give me a hard time. They don’t understand how hard it is to keep a website fresh and at the same time keep old things working correctly while making strides to make things better. It irks me, but I usually brush it off because people can be naive about things they don’t understand.

But, Rotheblog has had some major issues for….over a month??? I don’t even know how long and I deserve a hard time for the broken image problems I have had on the site as of late.

When I changed my permalink structure, that broke all my relatively linked images, which was a ton of images. I have periodically been going through and changing the links to absolute when I can, but I knew there was something like 1200 images that were broken. When I was making the original jump to WordPress, I had to have relative paths because I was inside of a “blog” directory. That is what kills me, I always always use absolute paths on all of my images.

So, today, I took a risk. I knew I could export my sql database file and do a find and replace, but my concern was what Dreamweaver might do to my file and my site. Although Dreamweaver has a great find and replace toolset, I know it can also screw up text based files like XML by adding / changing characters where there is supposed to be space.

Well, I consulted with a friend, and he said that he had never had any issue with Dreamweaver and .sql files, so I gave it a shot. 1085 changes in all, each change an image that was probably broken on the website. So, now, if you see a broken image, it “should” be the minority, and it is probably something I am not aware of and linked improperly to being with. *Hint Hint* so please let me know!

So, the lesson to all of the new WordPress users out there, setup your permalinking first! On a new WordPress install, change your permalink structure to match the SEO goals for your site. I am not obtuse enough to think all of my problems are solved, I have thought that twice now. But hopefully this is one more step to a better Rotheblog.com.


Permalink changes have continued to mess up my blog

Periodically, I have been surfing my own blog, and have found that things aren’t working how they should be.

Like today, for example, I figured out that none of the links in the right hand sidebar would consistently work. It depended what you were viewing, and if you had already clicked a topic, none of the links would work. After I changed my permalink structure a few weeks back, all relative links no longer worked, they have to now be absolute. So, my javascript menus weren’t working because my link to the script file was relative, and subsequently, all of the links in the right side didn’t work because they were linking to relative variables. So, today, I changed the permalink structure yet again, including the month and the year in the path so I could link directly to past months of posts, like I do for my Daily Life section.

So, I apologize to those that have felt like navigating my site lately has been a terrible experience. I need help in finding these problems, and I know there are probably a ton of broken images still….not sure how to find the time to fix those when I have to go one by one. If you see something, visit my contact page and let me know about it so I can get it fixed and be a little less embarrassed as I learn on a live site.

But hopefully, for now, the right side links should work again and I’ll do my best to find any other problems the blog is having.

This month I had 4 Gigs of traffic, and over 2000 unique users. Supposedly:) That is what Cpanel says. I did recently activate Google Analytics, I need to check out what that says for the past week when I was gone to get a more accurate snapshot of my web traffic.


Tutorial for setting up custom permalink structure in WordPress

Changing the permalink structure of my posts had been on my to do list for my WordPress based Rotheblog for quite some time, if not a month after I launched the redesign. I knew my apache server was configured with mod_rewrite available, so I didn’t have to worry about my server not supporting permalinking.

Short Sidebar

Don’t know if your server supports permalinks?

In your .htaccess file put this line of code;

RewriteEngine On

If the engine is not turned on, usually you will get a 505 error screen under certain configurations of Apache. If you don’t get an error, the engine is probably on.

I thought you might be able to figure this out by using phpinfo();, but that was the designer in me not understanding that that function is for php and you are looking for an apache config in httpd.conf.

I had tried setting permalinks up once before, updating my permalink structure in the admin control panel interface, but unsure what to do next as my website links were broken. I thought maybe I had to give my .htaccess certain permissions to allow the system to write the rules to it, but I didn’t make time to explore it in depth. WordPress should update that .htaccess file for you when you change the structure, but double check. Download the file yourself and look.

Turned out today, I tried again without exploring much more in depth, and got permalinking to work. I was nervous, not completely understanding the mod_rewrite engine, that any dynamic links pointing to my site would now be broken. But, the rewrite works on those links, no matter where they are.

Originally, my links were the default, and looked like this;

http://www.rotheblog.com/?p=1606

I added these rules to my Options > Permalinks > Custom Field

/%post_id%/%postname%

This will use the unique post id and then add it to the slug name of the post, which is dynamically generated from the title of the post. (Or it can be entered manually) My links will now look something like this;

www.rotheblog.com/1611/enabling-setup-permalinks-structure-wordpress

Then, all I did was download my empty .htaccess file from the server, and add these rules to it, and publish;

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

I found that these two sites were all I needed to setup my permalinking structure

  1. WordPress Codex
  2. Perishable Press

Now, I can have those keyword rich search engine friendly link titles available to use to my advantage.

For those of you who zoned out in the first sentence and are asking, “How does this affect me?” It doesn’t. It just means that my blog should be a touch easier to find in Google now that the link structure isn’t a variable name anymore.

Questions? Having issues yourself on how to setup your own permalinking structure? Leave a comment and I will help you out as best I can. If I can do it, so can anyone else.