Ecommerce Shopify WordPress Discussion

How do I add the rules to the htaccess file correctly and change the urls I need?

I wanted to change some url addresses on my wordpress site, without renaming folders. How do I add the rules to the htaccess file correctly and change the urls I need? All my attempt to do this were unsuccessful... Please help me solve my problem. I have an example of my broken code below. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^mytheme/(.+) /wp-content/themes/storefront/$1 [L,QSA] RewriteRule ^kyc/(.+) "/wp-content/plugins/my-reg-form/$1" [L,QSA] RewriteRule ^apps/(.+) /wp-content/plugins/$1 [L,QSA] RewriteRule ^includes/(.+) /wp-includes/$1 [L,QSA] RewriteRule ^media/(.+) /wp-content/uploads/$1 [L,QSA] RewriteRule ^review.php /wp-comments-post.php [L,QSA] RewriteRule ^content/(.+) /wp-content/$1 [L,QSA] </IfModule>
So you need to have a folder there. !Please take a thorough backup of files and database before you try anything! It's pattern replacement and not the other way around RewriteEngine on RewriteRule ^wp-content/uploads(.*)$ media$1 [L,R=301] The flags mean that L is last to be processed and R for Redirect. Please add it inside .htaccess but after the WordPress specific stuff and not in the same block as you show in the code. (Also mind that if you trigger the reproduction of permalinks this code might change) Therefore the http://example.com/wp-content/uploads/anything will become http://example.com/media/anything There is an excellent website that you can test all that: https://htaccess.madewithlove.com?share=d1f361ae-27f1-4bef-afd0-7fae6c1c7be5 Furthermore you need to add define( 'UPLOADS', 'media' ); into your wp-config.php file. Move your files to that location. Ensure that access in that location is allowed! Once you visit your media library the URL for each media file should be pointing in the new URL structure. I tested it on the https://htaccess.madewithlove.com/ and then on my live apache2 website. That's why I am using answer instead of comments.

February 4, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.