I want to redirect like http://example.com/sites-related-to-australia-0.html
.
In this "australia" and "0" are parameters. How can i do this using htaccess? i'm using php.
Any help greatly appreciated, Thanks!
It would likely be something like this:
RewriteRule ^sites-related-to-(\w+)-(\d+)\.html$ /somewhere_else.php?place=$1&pos=$2 [L]
/sites-related-to-
will be the first part of the URL RewriteRule ^sites-related-to-(\w+)-(\d+).html/$ sites-related-to.html?country=$1&val=$2 [L]
RedirectMatch sites-related-to-([^-]+)-(\d+)\.html$ http://www.anotherserver.com/something.php?country=$1&id=$2
Untested, see RedirectMatch
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.