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
Post a Comment