Support » Plugins » htaccess redirects in conjunction with Woocommerce page-caching

  • Hi all. I have a Woocommerce site configured to Geolocate with page-caching support, and of course this appends a query string to the end of all URLs, e.g.

    I’ve added rewrite rules to my .htaccess file in order to redirect from URL #1 to URL #2, while capturing part of URL #1 and appending it to URL #2 in a query string that can be captured in Analytics.

    Example URL #1:
    Example URL #2:

    So here’s what I have for the Rewrite rule in my .htaccess file:

    # BEGIN URL redirects
    <IfModule mod_rewrite.c>
    RewriteEngine On
    	RewriteRule ^/?v/(.*)$$1 [R=301,L]

    Note: I appended “/index.php” to the permalink URL for the product1 page. Hopefully that’s correct.

    What I get is a 404 at URL “”

    Now, I’m a newb when it comes to Apache and using regex in config files like this. While I have full intentions to put the time in to actually learn what I’m doing here (incl. best practices, etc.), I’ve just learned of this requirement and this site is currently live… I need to resolve this issue ASAP.

    Many thanks for any help!

  • The topic ‘htaccess redirects in conjunction with Woocommerce page-caching’ is closed to new replies.