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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -