skip to Main Content

I have a page like:

page.php?mode=dashboard&hl=en

and i want to use like:

site.com/dashboard?hl=en

how must i use RewriteRule? Thanks…

EDIT: I think this is not possible with .htaccess. Need to use javascript.

2

Answers


  1. wish it helps you

    # Redirect /Category.php?Category_Id=10&Category_Title=some-text
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteCond %{QUERY_STRING} ^Category_Id=(d+)&Category_Title=([w-]+)$
    RewriteRule ^Category.php$ /Category/%1/%2? [R=301,L]
    
    Login or Signup to reply.
  2. You may be able to use this code in site root .htaccess:

    RewriteEngine On
    
    RewriteCond %{THE_REQUEST} /page.php?mode=([^s&]+)&(hl=[^s&]+) [NC]
    RewriteRule ^ /%1?%2 [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(w-]+)/?$ page.php?mode=$1 [L,QSA]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search