Jump to content

Add a custom segment before "store" in .htaccess


Recommended Posts

Dear all,

We are about to expand to multiple countries and we'd like the following link structure (where "cc" is the country code):

https://www.example.com/cc/store/product-group

We already easily achieved this for our custom pages but we are not able to find the correct RewriteRule for this. We did try the following with no success:

RewriteRule ^(re|mu|fr)/store/(.*)(/?)$ index.php?country=$1&rp=store/$2 [L]

It causes a 404 error when accessing any link under /re/, /mu/ or /fr/. But if I go to the following link, it does show the correct page:

https://www.example.com/index.php?country=re&rp=store/product-group

I tried reaching out to WHMCS support but they advised to post here, so here I am.

I hope my post makes sense and I'd love to hear your thoughts about it!

Thanks : )

Link to comment
Share on other sites

Dear WhmTools,

It's the same product and same currency, just we'll do some changes on the product page to add some messages relevant to the country for SEO purposes.

Thanks.

Link to comment
Share on other sites

Is mod_rewrite enabled already?

Can you just try this simple rule in your .htaccess, to make sure the .htaccess rules will work as expected?

RewriteEngine On

RewriteRule ^my-cart/?$ cart.php [L]

 

then try to load website.com/my-cart and is it showing the whmcs cart page?

 

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

It is enabled. I ended up rewrite to a custom .php which rewrites $_SERVER['REQUEST_URI'] and $_SERVER['REDIRECT_URL'] before reincluding WHMCS's index.php.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated