Wordpress Url Rewrite and replace - php

i am trying to change the wordpress url with htaccess, i have the following scenario
My url will look like this, this will be visible to users.
http://www.example.com/custom-field-name1/custom-field2/post-name
While the actual url is this one
http://www.example.com/post-type-name/post-name.
Please help me how this will be possible with htaccess

I guess you require custom permalinks.
Using which you can change your permalink structure as you require with custom fields.
Kindly go through the following to know in depth
http://www.wpbeginner.com/wp-tutorials/how-to-create-custom-permalinks-in-wordpress/
Hope this helps you mate
Edit :
As per my suggestion htaccess is not necessary for this.

Related

Custom category URL wordpress

Can you help me with one issue? I want to understand how I can make WordPress URL like this structure. Examples:
http://sitename/category-1/subcat/article1
http://sitename/category-2/subcat/article2
http://sitename/category-3/subcat/article3
Searched all google but nothing found :(
General conditions is don't use any plugins or modify functions.php, only admin manipulations. Can anyone explain me how I can do this?
Thanks!
you can do it simply by adding the custom permalink as /%category%/%postname%/
Source: https://www.wpbeginner.com/wp-tutorials/how-to-include-category-and-subcategory-in-wordpress-urls/

Url Redirection Help Required

I am using Wordpress and Woocommerce. It is generating these ridiculously long URLs:
http://digital-dev.co.uk/a3m/shop/products/portable-stands/portable-counters/
I would like to alter it so that it reads like this:
http://digital-dev.co.uk/a3m/portable-stands/portable-counters/
I cannot seem to get a redirection working correctly for this. Can anyone help? Thanks in advance.
This is a great question. Have you edited the permalink structure in WordPress settings?
Here's a guide that contains information on how to edit the permalink structure: http://edenfried.com/things-you-should-do-after-installing-wordpress/#tab-con-4

URL rewrite for one page

I have a bilingual wordpress site that adds the language subdomain into the URL (e.g., mysite.com/en/first-page/. I am trying to find a simple way (can it be done via the functions.php file?) to rewrite the URL to have it remove the /en/, making the URL mysite.com/first-page/. Is this possible? I've looked at some tuts and a lot of them focus on stuff like archives and categories and I'm not sure they can help me.
Since you asked for a functions.php solution, you may be able to use add_rewrite_rule(). Something like:
add_rewrite_rule('^first-page/?', 'en/first-page/');
If that doesn't work, you should consider adding a rule to .htaccess.

Remove "title" word in Main URL in wordpress

How do I remove ?title= in Main Website url in Wordpress
Sample URL:
http://mydomain.com/propertiesdetail?title=this-is-title
Please Help. Thank you.
As far as I can understand you want to have 'nice' URLs.
Wordpress has built-in SEO and user-friendly URL rewrite implementation. All you have to do is check your Permalinks settings in Administration area->Settings.
Select to use not the Default, but Post name (or anything else, you can see all the options). This way all website URLs will be 'beautified' automatically, because Wordpress will rewrite the .htaccess file with the correct code.

How to change URL links that were made by WordPress?

I have a WordPress blog. All the post are currently in this convention:
http://www.myblog.com/blog/?p=1442
Now I'd like to change the URL of all posts like this one:
http://www.gomidjets.com/blog/this-is-my-post
While it's quite easy to apply it by changing the blog settings, the big problem is about the links I've placed
in many external website. I can't change them, and I'd like to map the old links to the new links somehow.
Do you know how to do it - if that's possible at all?
Do you have a better solution?
Thank you very much
Wordpress will map all old URL to new one, in case if you provided all URL in their original shape, such as http://example.com/?page_id=80
The answer is: you don't need to do anything.
I believe what you're looking for can be found in the admin panel.
In the admin panel (http://www.your-wordpress-site.com/wp-admin), go to Settings > Permalinks
Login to the admin panel first,
go for the settings->Permalink Settings
Select the format you want.
If you want change the base url for only some posts then you can edit from database.
Try this Redirection wordpress plugin to redirect your old url to your new url.
The URL's should resolve fine because the original URL you're using is the permalink one to my knowledge. If you're wanting end users to be redirected to this url, that's a bit harder.
That aside, I couldn't find any plugins that already did this. What you want to do is check the current URL against the wordpress function get_permalink() and if it doesn't match, redirect to the current permalink URL.

Categories