I've tried for ages to find a solution to this but to no avail.
In a nutshell...
I have a WordPress site within which I have a few pages that I want to change the URLs for. I don't want them to be custom post types if it can be avoided, I wish to use my theme's standard page templates without having to change or add any.
Can this be achieved simply using .htaccess? All my attempts have resulted in 404s so far. I've seen in the codex that you can do similar but not 100% sure how this works with pages instead of posts.
Note that I don't want a redirect, just to change the URL.
Example:
domain.com/page-reviews
I wish to be...
domain.com/page/reviews
The rule will always be the same, effectively anywhere that 'page-' appears, I need the dash to be replaced with a slash - 'page/'
Thanks to anyone who can help!
You can't do it through any .htaccess modification, if you are going to rewrite your slugs externally from Wordpress you will end up having 404 errors (or 500 or even a redirect loop, in the worst case scenario). Wordpress will look through its entire database searching for the matching requested path, which obviously would be inexistant.
If you want your pages to sit under a section, let's say /page/ you can easily create a Page with the slug page and then a child page with the slug reviews, so your final page will show the /page/reviews page, you need however to edit each page to amend the slugs where necessary.
If you are, however, using Posts then just use the Custom Permalinks plugin, it allows you to rewrite and add slashes into the full slug in the edit post screen, also in this case you need to go through all posts and change the slug pattern.
We've been using it flawlessly for about the last 2 years in a blog of a big corporate, however keep in mind the author is not maintaining it anymore so it might break at some point in the future and probably you might need to readapt it.
Related
Could you help me with the following predicament? I'd like to change the permalink structure of my website from the current one
/%category%/%postname%/
to
/%category%/%post_id%/
in a way so that the old publications could still be reachable through the old links?
Thank you in advance!
First, you need to 100% sure you want to make this change to your site because it will probably have an impact on your SEO, positive or negative.
Once you change your permalinks have been changed your WordPress installation will update all the links itself, however, links in the menu or any hardcoded links you will need to change yourself.
But to answer your question, you are best using 301 Redirects allowing anybody who happens to stumble across an old link make it to the correct page / post. There is a plugin that can achieve this called Simple 301 Redirects. The authors of this plugin note:
It's especially handy when you migrate a site to WordPress and can't preserve your URL structure.
This is a fair case for 301 Redirects. However, with Search Engines this is beyond your control unfortunatly. You will need to resubmit your XML site map.
My current blog is www.bostonsbettah.com and my current permalink set-up is http://www.bostonsbettah.com/%category%/%postname%/
Now, in a perfect world, the a post should appear as something like www.bostonsbettah.com/bostonbruins/boston-bruins-1st-line-playing-like-a-1st-line/ and that should take you to the post. When I click on the page title at the top such as "Bruins Blog", it should take me to www.bostonsbettah.com/bostonbruins/ that has an archive of all posts categorized as "Bruins". Currently, however, every page besides the home page is a 404 error.
Now I know I can fix something in the .htaccess file and I know how to access it, but I don't want to mess with it as I don't know how to code. Is there a fix someone can provide that will allow me to fix my website? Thank you in advance.
Never,ever,ever put your blog URL inside custom permalink structure!. You must use one of the structure tags, or a combination of tags only.
Read the documentation first.
Wordpress' permalink structure means that even if you don't put in the exact URL it redirects you to the most similar URL if there's something similar.
E.g.
Permalink = http://test.com/this-is-a-test-site-asdr5646/
Navigating to http://test.com/this-is-a-test-site/ would take you there.
This usually is suitable but I want to created hidden posts that are only accessible by using the exact URL, is this possible without creating a complex non-pretty URL?
I am moving an old Drupal 4 installation to Wordpress 3, and rather than trying to go through the pain of moving the thousands of posts over, my plan is to leave the old site running on a subdomain (old.site.com).
I'm able to set up the wordpress permalinks to look like the URLs the Drupal site's pathauto module was generating, but now I need to create permalinks for all those old posts that don't exist on the new site. For example:
http://site.com/author-name/title-of-post exists on the old Drupal site.
I want to create a permalink in Wordpress with the same URL, then have it forward to http://old.site.com/author-name/title-of-post
This way any existing Google indices that point to the existing post will still work, and (hopefully) we don't lose any Google prominence
What is the best way to do this? Thanks in advance.
Bonus Question: Does anyone actually know how this would affect SEO?
I would add the following plugin:
http://wordpress.org/extend/plugins/redirection/
And then create blank pages or posts in WordPress to get the link structure you want. The plugin adds an option to the post edit screen to set a 301 redirect to your other URL. That should provide the mechanics of what you want to do.
As for SEO, it's suboptimal for the new site since spiders, visitors, and bookmarks will all end up on the old site. I would use the above as a temporary solution and slowly copy/paste the content over or figure out a clever database import to move it over. In the long run, that will be better for you.
All my blog post URLs currently look like this: http://www.HeyItsMyBlog.com/?p=368
I want to change the URLs so instead they look like http://www.HeyItsMyBlog.com/2010/11/new-kittens-omg/
This is an easy change in the WordPress admin panel, but there are a bunch of people who have linked to my currently-formatted URLs around the web. How can I make the transition and ensure that it won't break the old links?
The latest version of Wordpress automagically interprets URLs of the form ?p=777 by redirecting the user to the corresponding pretty URL. You don't need to do anything special beyond enabling pretty URLs in the admin panel.
It works either way (when you set the permalink to your desired one). Test it of course. And oh, this question belongs to http://wordpress.stackexchange.com