php - redirecting specific page using htaccess -
i want redirect http://example.com/sites-related-to-australia-0.html
.
in "australia" , "0" parameters. how can using htaccess? i'm using php.
any appreciated, thanks!
it this:
rewriterule ^sites-related-to-(\w+)-(\d+)\.html$ /somewhere_else.php?place=$1&pos=$2 [l]
/sites-related-to-
first part of url- the next piece (a block of 1 or more word characters signified (\w+) (you can replace more specific (australia|united kingdom|france))) captured later $1
- the piece after next hyphen captured digit (\d) , stored $2
- load page somewhere_else.php variables place=$1 , pos = $2 (both defined earlier).
- [l] means last redirect rule effects particular pattern.
Comments
Post a Comment