I recently switched one of my blogs to permalinks, the links which turn:
example.com/index.php?p=3548
into
example.com/2007/08/this-is-my-post
I went through the Page slugs for a few of my pseudo-static pages such as About Us and Contact, and decided to shorten the Page slugs. For example, I wanted the Page titled “All About Us” to have a permalink URL of example.com/about
.
Everything went fine until I decided to change:
example.com/gallery_of_photography
to
example.com/gallery
I thought it was a nice move, shortening the name and URL. However it backfired.
The problem is that I have a directory for http://example.com/gallery
. Inside the directory are all the image files for my gallery Page.
Click on the Gallery link and it displays the file list of all the files within that folder. It certainly wasn’t the pretty gallery design and collection of images on a Page I’d so carefully crafted.
I went back in to the WordPress Pages panel and changed the post slug back. Once again, visitors can see pretty pictures on a web page not a list of files.
Take care in choosing your Page slugs in WordPress or other blogging programs which use permalinks. If they match your file directory, you could be showing off more than you want people to see. When you change the Page slugs, test them thoroughly to make sure they go where you want them to go.
Related Articles
- WordPress Pages: Exploring the Pseudo-Static Pages of WordPress
- Do-It-Yourself Search Engine Optimization Guide
- Getting Under the Skin of the htaccess File
- Creating a “Bad Code Day” Error Message for Your Blog
- Customizing Your WordPress Quicktag Buttons
- Comment Live Preview Placement
- WordPress Administration Panel Confusion – Changing the wpadmin.css
- How to Put Javascript in External Files
- Why I Choose WordPress as My CMS
- What I Needed to Learn About WordPress
- Using Author Template Tags Outside of the WordPress Loop
- WordPress Category Feed Links in Your Post Meta Data Section
- Display Post Excerpts Only in WordPress
- Genealogy Blog: Blog Contributors – Wanted Dead or Alive
Site Search Tags: wordpress tips, wordpress help, permalinks, URL, wordpress permalinks, folder links, wordpress pages, wordpress page links, page slugs, post slugs, page name slugs, page URL, page links
Copyright Lorelle VanFossen, member of the 9Rules Network Subscribe
6 Comments
Lorelle, a solution to that would be to first do a search and replace for /gallery/ on your blog to a new folder name(which you would have renamed) and then create the gallery slug.
I did that to my blog http://ajaydsouza.com/ when I got fedup of the piles of files in wp-content as the structure was from the pre 2.x days.
Just for the record: if like me (apparently because of hosting provider server settings) one cannot go for the true permalinks but only for the /index.php/gallery, then I guess there is no problem in that case.
Good point. I have my site setup to show permalinks for posts after the prefix “/blog”, so the site will show a post called “gallery” as [example]:
https://lorelle.wordpress.com/blog/gallery [using your site as an example as I don’t want to spam]
and the gallery will show as
https://lorelle.wordpress.com/gallery/
I am guessing, like you said, one needs to plan well. I myself chose the “blog/” structure just because I wanted to have something unique for posts and not confuse posts with the rest of the site. Reading your post, I am happy that I [hopefully] made a good choice.
Might want to check out this tip from Daniel Speed Up Your Site – Use Slashes on Your Links. The comments alone make it worth reading.
It might be too late now, but I also think the date isn’t needed in the URL. The date can help prevent duplicate URLs from being created, but a little care in naming posts can take of that too. Having a date in the path just makes previous posts look old increasing the chance that they’ll be ignored if they show up in search results. Just an opinion of course…
You are right. The date does not have to be in the URL. However, there are a few reasons why it should be.
If your content is date-oriented, it helps to date the content.
If your content is covered under the ISBN or other “published matter” licensing or registration, it must have some “obvious and blatant” (I think those are close to the words) date associated with the posts in line with published print material. Like a magazine “issue” date.
It prevents screw-ups with using the same post title. With the date, the title stays unique, even if you repeat the title “I have a great idea” 46 times. 😉
If none of those apply, you do not need dates in your URL.
3 Trackbacks/Pingbacks
[…] Battle: Permalinks Versus Folder Links […]
[…] Battle: Permalinks Versus Folder Links […]
[…] Battle: Permalinks Versus Folder Links […]