i try lots of but not finding proper solution. i want to redirect url query sting to .html page for example my url is www.mysite.com/page1.aspx?id=2 now i want to convert this url in to www.mysite.com/page1.html i hope it is possible . but i don't want to use javascript and sql server my hosting server is windows base. i use XML as a databse. also i use asp.net please help me
use htaccess : Options +FollowSymLinks RewriteEngine On RewriteRule ^page.html page1.aspx?id=$1 RewriteRule ^(.*).html page1.aspx?id=$1 PHP: it shod work fine ...!
I'm by no means a server expert, but something is telling me this is an Apache thing that may not work on windows servers
depend on what he is using : IIS or apache ! he can isntall : ISAPI Rewrite 2.0/3.0 for IIS it do the samre thing as htaccess~ The rewrite file look somthing lyke this: [ISAPI_Rewrite] # fix missing slash on folders # note, this assumes we have no folders with periods! RewriteCond Host: (.*) RewriteRule ([^.?]+[^.?/]) http\://$1$2/ [RP] # remove index pages from URLs RewriteRule (.*)/default.htm$ $1/ [I,RP] RewriteRule (.*)/default.aspx$ $1/ [I,RP] RewriteRule (.*)/index.htm$ $1/ [I,RP] RewriteRule (.*)/index.html$ $1/ [I,RP] # force proper www. prefix on all requests RewriteCond %HTTP_HOST ^test\.com [I] RewriteRule ^/(.*) http://www.test.com/$1 [RP] # only allow whitelisted referers to hotlink images RewriteCond Referer: (?!http://(?:www\.good\.com|www\.better\.com)).+ RewriteRule .*\.(?:gif|jpg|jpeg|png) /images/block.jpg [I,O] PHP: or he can isntall apache server on windows server and then he can use htacces |!
He said he's running ASP.NET which means he has to use IIS instead of Apache, which means mod_rewrite won't work.
Hi, You can redirect changing the header. Location : Header :domain name something of that sort. I am not sure about the exact syntax, but there is such a fascility in every programming language.
ok finally i get the solution of convert www . mysite . com/page1.aspx?id=2 to www . mysite . com/page1.html no i have other question. now google already index my www . mysite . com/page1.aspx?id=2 pages now i want to deindex (remove from index) this page and replace with www . mysite . com/page1.html how can i do this.or is it automatically replace when google again crawling this page?
i want to Use 301 redirect how i can redirect all the old pages to the new ones via just new lines of code.