skip to Main Content

I have domain with name www.example.com and I have created a sub directory (folder) with name of shop.com so final URL is www.example.com/shop.com/
however, www.shop.com is working fine.

Now, I am facing an issue with SEO friendly URLs

I have the following URL : www.shop.com/tshirt/value.php?url=nike

and I want to convert it into : www.shop.com/tshirt/nike

I am trying to write a RewriteRule for this.

Options +FollowSymLinks -MultiViews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
Rewriterule /tshirt/value.php?url=$1 [L,QSA,NC]

But this rule is not working. How do I handle the subdirectory correctly?

2

Answers


  1. add this line to your .htaccess file

    RewriteRule ^tshirt/([A-Za-z0-9-]+)$ /tshirt/value.php?url=$1;
    
    Login or Signup to reply.
  2. Please try this

    RewriteCond %{QUERY_STRING} (^|&)url=nike($|&)
    RewriteRule ^www.shop.com/tshirt/value.php$ /www.shop.com/tshirt/nike?&%{QUERY_STRING}
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search