: Htaccess URL rewriting I want to redirect a request look like mydomain.com/abc/def to mydomain.com/abc/index.php?q=def where abc is a fixed directory name and def can be any string. How can I
I want to redirect a request look like
mydomain.com/abc/def
to
mydomain.com/abc/index.php?q=def
where abc is a fixed directory name and def can be any string.
How can I do this using .htaccess?
More posts by @Odierno851
1 Comments
Sorted by latest first Latest Oldest Best
In .htaccess put:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} !id=
RewriteRule ^abc/(.+) /abc/index.php?id= [NC,L]
Note that I included a check for the presence of the id query string parameter to prevent the url mysite.com/abc/index.php?id=def from being rewritten.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.