You may be adding the directive to the wrong part of your .htaccess
file? It needs to go at the top, before the existing WordPress directives. You should also use RewriteRule
(ie. mod_rewrite) since you have existing mod_rewrite directives (the WP front controller).
Something like your 3rd attempt at the top of your .htaccess
file should result in the appropriate redirect. For example:
RewriteRule ^service-1\.html$ /our-services/1/? [R=302,L]
Change to a 301 (if that is the intention) only when you are sure it’s working OK. 301s are cached hard by the browser, so you will need to ensure the browser cache is cleared before testing.
The ?
on the end of the RewriteRule
substitution simply removes the query string from the request. Whether this is required or not is up to you, but you don’t have a query string in your example.
Related Posts:
- How to check if is in cart page? [closed]
- Remember page before login page, redirect to that page after login
- WooCommerce lost password reset flow not working with SendGrid (redirect loop)
- Custom Redirect after registration in WooCommerce
- Import products to WooCommerce by CSV page won’t open [closed]
- Woocommerce Login Redirect not working [closed]
- Redirect user after login through woocommerce login page to page with his/her username?
- Redirect customer to login page (with other signup plugin) if user not logged in when proceeding to checkout
- Woocommerce – Want to block a user agent from accessing specific product pages
- Woocommerce, prevent login after registration and redirect to custom URL
- Redirect no product url’s to static url
- WooCommerce Registration redirect based on page ID
- WooCommerce get_author_posts_url() – Author URL redirecting to shop base
- Add rewrite rule to make Woocommerce product category page seo friendly
- Woocommerce posts and products links works only once and then get 404 error
- Is it ok to 301 redirect product-category pages to custom pages?
- WooCommerce and ACF: How to Redirect Upon Add to Cart – Partially Working Example
- wordpress site auto redirect to another site when I enable woocommerce
- mydomain.com/wp-login redirects to wordpress.com/wp-login
- Change wp-login.php? Problem with .htaccess password protection and multi user shop
- WooCommerce shop, my account, cart every page redirect to home page [closed]
- Woocommerce 404 after chang default language
- How to redirect all HTTP requests to HTTPS
- htaccess – Redirect to subfolder without changing browser URL
- Generic htaccess redirect www to non-www
- Redirect old php link to wordpress link in .htaccess
- Redirect old php link to wordpress link in .htaccess
- Safely redirect old WordPress blog links to new WP blog
- Double slashes on WordPress Admin URL redirects to wp-login
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- Woocommerce – Add a product to cart programmatically via JS or PHP [closed]
- ( Woocommerce) How to get the user belonging to an order? [closed]
- Get the product list of a given Category ID
- “Too many redirects” ONLY when trying to access wp-admin page
- List of JS events in the WooCommerce frontend
- get woocommerce My account page link
- How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
- WooCommerce: How to edit the get_price_html
- Get woocommerce product price by id [closed]
- Product categories don’t appear as option to build menu
- WordPress Redirect All HTTP requests to HTTPS via .htaccess
- WooCommerce Variable Product Price not showing on single product page
- Redirect entire website to a single page
- Check IF is a “single product page” and Check the “role” for a Redirect
- How to override WooCommerce template files?
- Woocommerce add extra field to variation product
- Getting the gallery images from products in woocommerce?
- How to get current product category ID in product archive page
- Get url of product’s images (woocommerce)
- WooCommerce prices location in DB
- Order by rating not works in wp_query
- Woocommerce: How to remove page-title at the home/shop page but not category pages
- Woocommerce show cross sells on singe product page [closed]
- How to add a new endpoint in woocommerce
- Are there any hook or filter when refund is done through admin -woocommerce
- Display single product attribute value on Shop page (Woocommerce)
- WP/WooCommerce REST API cart/checkout/order [closed]
- how to use wc_create_order with subscription product
- WooCommerce: Webhook disabled on its own
- Stop WordPress and Plugins from Overwriting .htaccess
- Share users and WooCommerce memberships between two installations
- Slow Loading Attribute Select – WooCommerce Backend
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- How to change or add Woocommerce thank you page URL key content?
- How can I define a custom template for woocommerce [products] shortcode? [closed]
- How to remove an action within a class with extends
- 301 Redirects for Changed Permalink Structure & Category Base
- single-product.php template not working for single products [closed]
- Insert variations via woocommerce api [closed]
- Old blog/ and blog/feed/ URLs not working after moving blog to top-level via .htaccess
- WooCommerce get physical store address
- Is it possible to add custom fields to a WooCommerce attribute term? [closed]
- Non-WordPress page in subdirectory under WordPress page
- wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?
- Force HTTPS using .htaccess – stuck in redirect loop
- how to get woocommerce product attribute slug
- Correct function to get the user’s latest Woocommerce Subscription?
- Move payment options at checkout in WooCommerce [closed]
- PHP – redirect https to http and www to non-www
- add_filter to modify woocommerce_cart_item_name hyperlink
- How do I turn off 301 redirecting posts (not canonical)?
- Where do the cart details are stored in database?
- How to display product price of the product in loop
- Passing variables through permalink structure
- How to disable Woocommerce password recovery and use the default WordPress password reset page?
- Redirecting WordPress /.htaccess / HSTS / SSL
- 301 redirect not working through .htaccess
- Display order items names in WooCommerce admin orders list [closed]
- Wrong canonical link on wp-admin pages
- Is it safe to delete from db orphaned posts i.e. whose post_parent no longer exists?
- Site redirects to wrong url when saving settings
- WordPress Multisite – Multiple subfolders for blogs
- WordPress multisite subdirectory redirect infinite loop issue
- Add custom variable to cart content [closed]
- Get product details by url key in WordPress woocommerce
- Get product link
- WooCommerce – Hook after Loading Variation in Admin Edit page?
- How to delete woo commerce order pragmatically? [closed]
- WooCommerce changes lost password reset link