Gaurav Awasthi
Gaurav Awasthi

Reputation: 37

htacess URL rewriter not working on my hosting

I am trying to change my URL http://windllfiles.com/dlldata.php?name=All.dll to http://windllfiles.com/All.dll/ and http://windllfiles.com/?character=B to http://windllfiles.com/character/B/

I am trying to write my redirect URL for http://windllfiles.com/dlldata.php?name=All.dll as

 Options +FollowSymLinks
RewriteEngine on
RewriteRule dlldata/name/(.*)/ dlldata.php?name=$1
RewriteRule dlldata/name/(.*) dlldata.php?name=$1

and for http://windllfiles.com/?character=B as

Options +FollowSymLinks
RewriteEngine on
RewriteRule /character/(.*)/ ?character=$1
RewriteRule /character/(.*) ?character=$1

but both are not working

Upvotes: 0

Views: 52

Answers (1)

RavinderSingh13
RavinderSingh13

Reputation: 133528

Could you please try following, written and tested with shown samples. Please make sure you clear your browser cache before testing your URLs.

RewriteEngine ON
RewriteRule ^(All\.dll)/?$ dlldata.php?$1 [L]
RewriteRule ^(character)/(B)/?$ ?$1=$2 [L]

first rule rewrites urls starting from All.dll to dlldata.php?$1 where $1 is first back reference value. 2nd rule applies for uris starting from character/B then rewrites to them to ?$1=$2.

Upvotes: 1

Related Questions