regex - url rewriting not working as wanted -



regex - url rewriting not working as wanted -

i trying accomplish clean url looks http://localhost/slugs/this-is-my-first-slug-post

but instead have http://localhost/slugs/news.php?newsheadline=this-is-my-first-slug-post

i have htaccess file code doesn't seem work.

rewriteengine on rewriterule ^[a-za-z-]+/([a-za-z0-9-]+)/?$ news.php?newsheadline=$1 [nc,l]

you can utilize rule:

rewriteengine on rewritebase /slugs/ rewritecond %{the_request} /news\.php\?newsheadline=([^\s&]+) [nc] rewriterule ^ %1? [r=302,l,ne] rewritecond %{request_filename} !-d rewriterule ^([\w-]+)/?$ news.php?newsheadline=$1 [qsa,l]

regex apache .htaccess mod-rewrite redirect

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -