URL rewrite - Automatically - not manual
I have written a rule for redirecting in .htaccess file开发者_如何学运维 its redirecting for some pages , if we give that link manually.. but what i want is ,it should redirect automatically....
My requirement is :
Instead of this link,
links.php?page=1&ipp=All&exchange=adddata
It should be redirected automatically
http://example.com/folder1/links/1/All/exchange.html
MY rule in .htaccess is
RewriteEngine On RewriteRule ^([0-9]+)/All/exchange.html$ links.php?page=1&ipp=All&exchange=adddata
It's not completely clear by your example, but it could be this:
RewriteEngine On
RewriteRule ^links.php?page=([0-9]+)&ipp=All&exchange=adddata$ folder$1/links/$1/All/exchange.html
In the comment above you mistakenly swaped the original url and the url it should be redirected to plus you didn't set any dynamic parameters in your new url - which I suppose you need. But as I said, to be sure about it we'd need more examples.
Hope this helps!
精彩评论