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
- Display single product attribute value on Shop page (Woocommerce)
- Is it possible to add custom fields to a WooCommerce attribute term? [closed]
- Site redirects to wrong url when saving settings
- Woocommerce 3.1 Add product image to order confirmation email not working
- Woocommerce My Account Endpoint – how to get ID parameter from URL?
- How to add Woocomrce cart page shipping calculator to my country state list
- htaccess redirect dynamic posts
- Button to update order status Woocommerce with WC Marketplace
- RedirectMatch and Redirect interfering with each other
- WooCommerce add_to_cart url not working [closed]
- WooCommerce: display text instead of raw checkbox value email
- How to build wordpress site which will have location based services & products?
- How we can edit variations on cart page? [closed]
- new WC_Order(); Coming Back Empty
- Is there any way to find which action/hook is fired?
- htaccess rules not applied?
- WooCommerce single products images doesn’t zoom on hover and doesn’t change clicking on gallery
- Redirect subdomain in Multisite installation?
- Order list woocommerce Orders based on meta for custom status
- WooCommerce hide unexisting variations
- 301 redirection editing .htaccess doesn’t work
- How can I change the functionality of breadcrumbs?
- Redirect custom post type from one domain to another domain
- Variation name in $product->get_name()
- 301-redirect directives for blogger to wordpress migration
- How do I group product variations on cart page (Woocommerce)?
- What’s the fastest way to import products with variations in WooCommerce (CSV, XML, …) [closed]
- Redirect – remove custom query string
- Woocommerce’s add_to_cart function returns false and doesn’t add anything to the cart [closed]
- WOOCOOMERCE: Run function before payment gateway (paying)
- How to check woocommerce single product tag
- Comment author url link is wrong? How to change from authors/ to author/
- Can’t filter out variable products in sale from wp_get_products loop (or shortcode) [closed]
- Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]
- What Hook/Action is performed when a field in checkout form is changed in WooCommerce
- Benefits over using object method over property from $product?
- Colour of selected radio button seems backwards in Twenty Seventeen + Woocommerce
- WooCommerce – change child category URL structure
- Customizing WooCommerce
- Custom WooCommerce rewrite rules with comma delimiter
- Set city as required if country is Singapore
- Woocommerce custom taxonomy filtering
- How to change product category permalinks programmatically?
- Make e-Mail optional on Woocommerce sign up
- 301 all old pages to new location
- Sharing data between filters on a snippet (user specific) for Woocommerce
- Create order actions from custom fields woocommerce
- How can I send information when a order is completed to my own POS?
- Understanding Redirects
- Woocommerce doesn’t work with theme, header missing and css messed up
- Woocommerce Product Variation – Add Price Logic
- How to change lost password email text using custom plugin wordpress?
- wc_mail in foreach loop is sending only the first email
- How to fix: “The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.” after malware cleaning
- Can’t update WooCommerce payment method title
- Set Post Thumbnail to external URL
- How to add product variations for large number of products in WooCommerce?
- WooCommerce related products load random posts per page
- Woocommerce Languages Files
- How to adjust Related Page Thumb Sizes on single page?
- Adding more than one item to Woocommerce cart
- Allow GET request on certain page
- Changing second user role while updating/downgrading membership level – s2member [closed]
- How to edit the header banner in the search page in woocommerce?
- How can I display one product using WooCommerce
- How do I change the woocommerce product gallery to show all thumbnails instead of three at a time in a carousel?
- How to add a menu page for options in wordpress for user that has the role of vendor?
- Need rewrite for URL with specific string
- How to edit schema.org markup of WooCommerce?
- Turkish Character Problem on mailing
- WooCommerce: Order Details Table > Add Product Meta
- How to Redirect Url to homepage?
- Override function
- How to disable schema from Wocommerce? [closed]
- Adding a column to woocomerce admin order page that can be sorted
- WordPress error
- Auto generating API keys using the Application Authentication Endpoint [closed]
- Is there a way to conditionally check if i’m on product variation page url like mydomain.com/myproduct?attribute_pa_color=red