php - Using .htaccess to rewrite urls with ID: "Page not found" -


i trying rewrite urls using .htaccess file in wordpress environment. have wordpress page called "offerta" 2 parameters, 1 of them custom id use generate content.

so, example url is: http://www.riccionelastminute.it/rlm/offerta/?id=15&titolo=my-title

and be: http://www.riccionelastminute.it/rlm/offerta/my-title-15/

this .htaccess right now:

# begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase /rlm/ rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /rlm/index.php [l] </ifmodule>  # end wordpress 

after research, tried add rule right after last rewrite rule, redirects 404 page:

rewriterule ^offerta/([a-za-z0-9-]+)-([0-9]+)/$ offerta/?id=$2&titolo=$1 

i'm not used play around .htaccess , i'm not expert. missing something?

the problem last rewriterule has l flag means no other rules applied after it. need add rule before last one:

<ifmodule mod_rewrite.c> rewriteengine on rewritebase /rlm/ rewriterule ^index\.php$ - [l]  rewriterule ^offerta/([a-za-z0-9-]+)-([0-9]+)/$ offerta/?id=$2&titolo=$1  rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /rlm/index.php [l] </ifmodule> 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -