Jump to content
SametALMDR

How to redirect sef url

Recommended Posts

Hello everyone,

I'm trying to redirect domain.com/cart.php?a=add&domain=register  url to  domain.com/domainregister using .htaccess in the root folder of whmcs. I tried many things but does not work.

Any of you know how to do this operation using .htaccess guys ? Please help mee ūüėě

Share this post


Link to post
Share on other sites

I'm trying something similar - redirecting one product to another (e.g. pid=10 to pid=11, since pid=10 is out of stock). Cant get it work using .htaccess

Share this post


Link to post
Share on other sites
RewriteCond %{QUERY_STRING} domain=register
RewriteRule ^cart\.php$ https://example.com/domains/register? [R=301,L]

Having the question mark ("?") at the end of the redirect to URL removes the query string and so if you want to keep it then remove that question mark. 

Share this post


Link to post
Share on other sites
9 hours ago, steven99 said:

RewriteCond %{QUERY_STRING} domain=register
RewriteRule ^cart\.php$ https://example.com/domains/register? [R=301,L]

Having the question mark ("?") at the end of the redirect to URL removes the query string and so if you want to keep it then remove that question mark. 

Thanks @steven99, I'm trying to use this approach to redirect from one product to another  and this is what I have so far:

### END - WHMCS managed rules - DO NOT EDIT BETWEEN WHMCS MARKERS ###
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{QUERY_STRING} pid=11
RewriteRule ^pid=11$ https://www.domain.com/whmcs/cart.php?a=add&pid=17 [R=301,L]
</IfModule>

However, it doesn't seem to work.  The old product (pid = 11) is marked out of stock and hidden on the order form, so it keeps redirecting me to the group page instead of pid = 17

Share this post


Link to post
Share on other sites

The rule should be:

 

RewriteRule ^cart.php$ https://www.domain.com/whmcs/cart.php?a=add&pid=17 [R=301,L]

Share this post


Link to post
Share on other sites
6 hours ago, steven99 said:

The rule should be:

 


RewriteRule ^cart.php$ https://www.domain.com/whmcs/cart.php?a=add&pid=17 [R=301,L]

Thanks steven. I tried this and it seems to redirect every product to that link - I only need one (pid=11) to redirect.

Share this post


Link to post
Share on other sites

That is where the

RewriteCond %{QUERY_STRING} pid=11

part comes in.  You have that right before the rewriterule and it will trigger the rule only if the pid=11 is in the query string.

 

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks @steven99. Also, there is a problem with that link domain.com/index.php?rp=/login . I want to just connect this link to  domain.com/signin. I tried many things and options from the admin panel.

RewriteRule ^signin$ ./index.php?rp=/login [NC] 

Is the above rule is correct? @steven99

 

Edited by SametALMDR

Share this post


Link to post
Share on other sites
On 1/06/2021 at 5:23 AM, steven99 said:

That is where the


RewriteCond %{QUERY_STRING} pid=11

part comes in.  You have that right before the rewriterule and it will trigger the rule only if the pid=11 is in the query string.

 

Thanks, that did the trick!

Share this post


Link to post
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.


  • Similar Content

    • By DutchieXL
      Hello,
      I have been struggling with this problem for some time now.
      In the file seo.tpl I am using:
      {if $LANG.globalsystemname eq "Portal Home"}
      to edit the seo for the homepage.
      The problem I encounter is that the seo of all the knowledge base articles is also changed into the homepage seo.
      this also happens when I use:
      {if $filename eq "index"}

      At the end of the file I am using:
      {else}
      <title>{if $kbarticle.title}{$kbarticle.title} - {/if}{$pagetitle} - {$companyname}</title>
      <meta name="description" content="{$kbarticle.text|truncate:210:"..."|strip_tags}" />
      for the kb articles which works perfectly when I disable the homepage seo.
      As soon as I enable the homepage seo with one of the above options the kb articles all get the homepage seo.
      Is there a way to set the homepage seo without affecting the kb articles seo?
      Any help is appreciated.
      Thanks,
      René
    • By Sal
      Hello WHMCS Community, 
      I am Sal, I'm currently working on hosting administration so I am here to share what I know and to learn what I do not. Other things that I work with is Salesforce, Web Design, SEO, Digital Markting, and local phone, tablet and computer repairs!
      I have recently started the implementation of whmcs for my hosting company, I am still debating on many aspects of what is what with WHMCS Software. You may see me posting question about a few things that I need help with on WHMCS, so far my experience has been great and i look forward to making the hosting company a success!
      Thanks for reading!
    • By sitesme
      Today we got a message from Google Webmasters to "Fix mobile usability issues" on our WHMCS installation.
       
      Some of the errors found were described in our Google Webmasters area: /http://d.pr/i/jqSB/eUL8rA0w
       
      This is all regarding to the responsive problems and Google seems to be ranking with lower scores the websites that are not responsive or mobile-friendly.
       
      I heard WHMCS 6 is going to be launched soon - will it solve this issue?
       
      I am really looking forward for the new refreshed design on WHMCS. The admin are looks from the 90's and a re-design is really a must. V6 will probably solve most of it but maybe not all?
       
      Using 3rd party themes could be an option but I would like to move away from them as much as possible, unless there is no other way to fix these issues in a short- or medium-term.
       
      Any thoughts on this?
       
      All the best
    • By nimonogi
      This addon will 301 redirect to the correct Search Engine Friendly URL.
       
      THE PROBLEM:
      After changing some knowledgebase article's titles, I've noticed that articles can be accessed through old URI as well. Even worse, can be accessed using any URI as long as it has the ID inside the path. Announcements have the same behavior as well.
       
      For example, all URLs below will show the same content:
      1: yourdomain.com/knowledgebase/15/Transferring-Your-Domain-from-NameCheapcom.html
      2: yourdomain.com/knowledgebase/15/Transfer-your-Domain-from-NameCheap.html
      3: yourdomain.com/knowledgebase/15/JUST-ANYTHING.html
       
      This is a extremely negative for SEO as it produce duplicate content.
       
      SOLUTION:
      This addon will fix that by 301 redirecting to the correct Search Engine Friendly URL.
       
      For More Details please visit our WHMCS Addons page.
    • By sentq
      This script will add support for Non-Latin characters in WHMCS Knowledge Base URLs.
      by default WHMCS allow only Latin (a-z) characters in SEO URLs, after installing this action hook all Knowledge Base URLs will be re-generated and all Non-Latin characters will be translated to Latin characters and give you valid and search engine friendly URLs.
       
      Mod Type:
      Action Hook
       
      This Mod features:
      1) Re-Generate URLs for articles and categories inside WHMCS knowledge base.
      2) Re-Generate URLs for bread crumbs in the same section to.
      3) No template modification required.
       
      How to Install:
      1) Download the ZIP from: http://whmcms.com/downloads/6/Free-Hooks-and-addons-modules#item1
      2) Upload the contents from #1 to " /includes/hooks/ " directory
      3) Activate "KB SEO Friendly URLs" feature from Admin area > Setup > General Settings > Support tab.
  • 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