regex - "Two Way" Rewrite -



regex - "Two Way" Rewrite -

so, i'm trying accomplish this:

we have url /brand/new-inventory.php. physical file within our site. i'd /brand/new. easy. had add together rewriterule ^brand/new$ brand/new-inventory.php [l,qsa].

now, i'd setup , i've been struggling this:

we need /brand/new-inventory.php when viewed redirect /brand/new have consistent url's , what-not.

but, when seek rewriterule ^brand/new-inventory.php$ brand/new [r=301,l] firefox starts complain redirect loop never end.

how can rewrite page respond different url, , redirect old url new one?

have way:

rewritecond %{the_request} \s/+brand/new-inventory\.php[/\s?] [nc] rewriterule ^ /brand/new [r=302,l] rewriterule ^brand/new$ /brand/new-inventory.php [l,nc]

difference utilize of %{the_request} represents original request received apache browser. value of variable doesn't alter application of other rewrite rules.

regex apache .htaccess mod-rewrite redirect

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -