Reputation: 2731
I am trying to write a rewrite rule for the following URL from
to
https://example.com/news/?view=read&newsArticleID=4184
I tried a few rewrite rule like the following but it does not work -
RewriteEngine on
rewriterule ^news/([A-Za-z0-9-]+)([^--]*)$ /news/?view=read&newsArticleID=$2 [L]
Any help will be highly appreciated.
Upvotes: 1
Views: 20
Reputation: 784888
Try this rule:
RewriteEngine on
RewriteRule ^news/.*-(\d+)/?$ news/?view=read&newsArticleID=$1 [L,QSA,NC]
Upvotes: 1