avoiding a redirect loop with rewrites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm working for a small company that uses a custom CMS.  When
customers create pages in the CMS a file gets created based on the
page's id number - for example:

www.mysite.com/pages/pid5.html

I've pushed some code into the CMS that lets the site admin create a
nice URL for each page so you get something nicer like:

www.mysite.com/products.html

The pid5.html file still exists but now they should see the new URL
everywhere on the site.  The rule I used for this was:

RewriteRule ^products.html$ /pages/pid5.html [L,QSA,NC]

One of the folks in charge here wanted to make sure that for
existing sites anyone who still had the old URL bookmarked or search
engines that have the old URL gets a permanent redirect to the new
one to avoid having two URLs that go to the same place.  I thought
I'd do this with a RedirectPermanent, but when I do that I get a
redirect loop.  I also tried creating rewrite rules for the pid5.html
page - no luck.

Basically, is there any way to have a rewrite rule map a new URL name
to an existing page, and also a permanent redirect for anyone using
the old URL name.  I would have to think this has come up before but
wasn't able to find anything.

Thanks for your help,

Josh

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux