-1

How can i implement wordpress like url rewrite logic , if some one adds /feed/ at the end of any url then it should forward all get parameters to specific page .,

i tried doing something like this

RewriteRule ^feed/?$ rss.php [L]

RewriteRule ^feed/?$ rss.php [QSA,L]

and tried catching data like

rss.php

<?php
print_r($_GET);
?>

but it keep refreshing the current page where the link is placed.

e.g. this

domain.com/browse/flowers/feed/

go to

domain.com/rss.php?category=flowers&feed=on
  • possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) – James Mar 17 '15 at 17:21
  • @anubhava there are multiple GET parameters and 3-4 and 2 of them are optional. so i gotta catch everything which comes before ending /feed/ –  Mar 18 '15 at 02:21
  • Then below answer should work for you. – anubhava Mar 18 '15 at 10:26

1 Answers1

2

something like this should do it:

RewriteEngine On
RewriteRule ^?/browse/(.*)/feed/?$ rss.php?category=$1$feed=on [L,NC,QSA]