Trying to create fake folder structure.
Essentially what I want is any request to http://www.example.com/** (where ** equals any two letters) to redirect to http://www.example.com/folder/index.php?var=** (where ** equals the two letters from the first link)
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^/(.*)$ http://www.example.com/folder/index.php?var=$1
This is what I have right now, but it isn’t working. Any ideas?
Remove the leading
/from theRewriteRule. The expression matched on the left side should not begin with/as aREQUEST_URIwould. You can also omit the entirehttp://example.comfrom the right side, since you are rewriting on the same domain.If it should match only alpha chars, it is recommended to limit the expression further (beyond
.{2}, which matches 2 of any character)