I have a page with a URL like
http://www.example.com/subcategory/therealthing.
This URL should stay like this but I need to create a shortcut that looks like
http://www.example.com/realthing
That shortcut should take the user to the site with the longer URL
A method that is SEO friendly would be perfect.
What's the easiest way if I don't want to change the permalink of the original site? I guess htaccess won't work for this?
Funny, I just answered something very similar to this. See the redirection plugin. Much easier than editing your .htaccess file yourself. Particularly if you need to do it a lot.
Take a look at the feature list for the redirection plugin. This allows you to setup redirects to other pages or do pass through redirections.
If you are happy with redirects .. then you can add this kind of rule into your htaccess file (but it has to be placed before WordPress rules -- if not sure/does not work -- provide your current whole .htaccess):
RewriteRule ^realthing$ /subcategory/therealthing [R=301,L]
or you can try
RedirectMatch 301 ^/realthing$ /subcategory/therealthing
Redirection is not a more reliable solution. You should use this plugin in which you can customize every permalink without any problem https://wordpress.org/plugins/custom-permalinks/
Related
I've had my WordPress site for about a decade now, and originally I never set any custom settings for permalinks, so my permalinks are all of the form /?p=123.
I'd like to start using permalinks that incorporate the post name in the URL. It looks easy enough to change this. It's my understanding that WordPress will likely update all my permalinks internally, but there exist a lot of external links to my site that point to existing permalinks, and I don't want those to stop working.
Will WordPress keep supporting visits to old plain-style permalinks if I change the setting? It seems like it should be able to since it's just using a URL query param and the other permalink styles use the URL's path, but I don't want to assume it does and be wrong.
And if this is not the case, is there a straightforward way I can set up the redirects? I have hundreds of posts and it would be tedious to make a manual redirect for each one.
Update: yes, the plain style permalinks keep working after you set another structure for your permalinks. They will redirect.
I'm having a problem with site migration and old links. Now, its not just a server migration, it was also a CMS migration. Site went from umbraco (asp.net) to wordpress. Problem is that google indexed old URLs. We have a way to rework links to make them work. I've been using this method to rework links and used WP plugin for redirect. The problem is there is way to many links for this plugin.
I was wondering is there any way to rework links dynamically with htaccess.
So, here is how links should be rewritten:
http://example.com/something/XXXXX-some-text.html
-->
http://example.com/something/some-text-XXXXX
where XXXXX is some number between 100 and 100,000
This method works, only problem is that there is more then 60,000 links...
Any suggestions?
P.S.
There are also some other links that should be skipped, cause we don't have a way to rework them...
Is this what your want?
RewriteEngine on
RewriteBase /
RewriteRule ([a-zA-Z\-]+)/([0-9]+)-([a-zA-Z0-9\-]+)\.html /$1/$3-$2 [L,R=301]
Put this at the top of your .htaccess file in Wordpress installation.
( ): will capture a string
$#: will print the captured string in the redirection
$1: will print the first captured string
$2: will print the second one
$3: will print the third one
You can use this tool to test that kind of simple rules.
Sorry if my question was basic or stupid. Please help me how to do this thing i m new to wordpress.
I have permalinks for pagination page like this
www.website.com/customtaxonomy.html/1
www.website.com/customtaxonomy.html/2
but i need to change this permalinks as
www.website.com/customtaxonomy.html?page=1
www.website.com/customtaxonomy.html?page=2
only for paginations pages.
I cant comment as I need 50 rep. I believe that you will need a custom function for this, maybe this will help: https://wordpress.stackexchange.com/questions/57070/change-the-page-slug-in-pagination - its not directly the same but might help you figure it out. The only other thing I can suggest is a rewrite with the .htaccess file. Give this a ganders: simple .htaccess redirect : how to redirect with parameters?
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.
Until recently the custom url structure was set like this:
/%year%/%monthnum%/%postname%
and they were all located in the /blog/ subfolder.
Due to pagination issues I changed the permalink to the standard:
domain.com/sample-post/
What I'm wondering is, is there some way I can use htaccess to redirect from the old style to the new style? That way, any links to the old posts would go to the correct post? Any suggestions?
If you need to update your permalink structures you might like to look at Velvet Blues Update URL's Plugin: http://wordpress.org/extend/plugins/velvet-blues-update-urls/