Reputation: 61
Trying to figure out how to rewrite the following in server.conf. Any help would be greatly appreciated. Have been at this for a couple hours now and can't seem to get it to work.
www.maindomain.com/##### from a url that looks like wwww.maindomain.com/?id=##### where # signs are numbers.
I have tried all types of scenario's. Here are some that I have tried
RewriteRule ^(.*)$ /?Id=$1{QUERY_STRING} [PT]
RewriteRule ^(.*/)$ /?Id=$1{QUERY_STRING} [PT]
RewriteRule ^(/.*)$ /?Id=$1{QUERY_STRING} [PT]
RewriteRule ^/(.*)$ /?Id=$1{QUERY_STRING} [PT]
Upvotes: 1
Views: 86
Reputation: 3346
This should work (not tested): Change index.php to your home page file.
RewriteRule ^/?([\d]+) index.php?Id=$1 [QSA,L]
Upvotes: 1