regex - How Do I redirect to php file with Htaccess -


is there way redierct url php file based on 1 part of url.

for example have url -

http://www.website.org/cat/89/diamond-wedding-rings.htm

i have few different of these urls. wish redirect pages /cat/ php file pull id , display category , products.

in htaccess have

rewriterule ^cat/([0-9]+)/(.*)\.htm category.php?cat_id=$1&title=$2 [nc,l] 

i'm not getting 404 because cms system redirects homepage if page not found.

i'm complete noob when comes htaccess , i'm basing on of existing rules in htaccess similar. don't need title part it's id.

if need id work

rewriterule ^cat/([0-9]+)/(.*) category.php?cat_id=$1 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -