So, I'm trying to accomplish this:
We have a URL /brand/new-inventory.php
. This is a physical file within our site.
What I'd like it to be is /brand/new
. Now that was easy. All I had to add was RewriteRule ^brand/new$ brand/new-inventory.php [L,QSA]
.
Now, what I'd like to get setup and I've been struggling with is this:
We need /brand/new-inventory.php
when viewed by someone to redirect to /brand/new
so we have consistent URL's and what-not.
But, when I try RewriteRule ^brand/new-inventory.php$ brand/new [R=301,L]
Firefox starts to complain about a redirect loop that will never end.
How can I rewrite a page to respond to a different URL, and redirect the old URL to the new one?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…