Forum Moderators: phranque
redirect 301 /_english/index.html http://www.example.com/index_e.php
<snip>
redirect 301 /_francais/liens/index.html http://www.example.com/index_f.php?s1=li
redirect 301 /_francais/map_f.htm http://www.example.com/index_f.php?s1=map-index
Thank you
[edited by: jdMorgan at 7:48 pm (utc) on Jan. 21, 2009]
[edit reason] Examplified, trimmed. Please see Terms of Service. [/edit]
The most likely cause is either a syntax error or a new redirect that matches the output of an existing redirect, and which redirects to a URL that matches that first redirect -- Setting up an 'infinite' redirection loop. Your server error log may be most useful to you (and to the members here) in providing the information needed to find this, if it isn't obvious.
Also, please do not use your real domain name -- both to comply with our terms of service and to protect your own site.
Thanks,
Jim
redirect 301 /_english/fil/fil_5/fil_5a_e.htm#codexrep http://www.example.com/index_e.php?s1=idf-fil&s2=codex&page=rep-rap
redirect 301 /_francais/fil/fil_5/fil_5a_f.htm#codexrep http://www.example.com/index_f.php?s1=idf-fil&s2=codex&page=rep-rap
There is potentially a much larger problem here, in that you are redirecting from 'SEO friendly' URLs to dynamic (and therefore 'unfriendly') URLs, and telling the search engines to replace the friendly URLs with the unfriendly ones. This can cause trouble in two ways: First, search engines, although they are getting better, handle static-looking SEO friendly URLs better than they do dynamic URLs. And secondly, if you link to SEO-friendly URLS and then redirect every request for such URLs, you will leave the search engines in a permanent state of confusion, and they will therefore lower their 'quality rating' of your site. In addition, every client that requests one of the friendly URLs will suffer the delay of waiting for the server to respond with a 301 redirect, and then have to re-request the desired resource using the dynamic URL provided in that 301 response. So, the client must send two requests and wait for two replies from your server for every page requested. This of course will also make a mess of your log files, and skew your site statistics, showing two page loads for every page actually delivered.
The bottom line is that I believe you would be far better off using internal rewrite (mod_rewrite) instead of external redirects. You may also benefit greatly from using the power of regular-expressions pattern-matching to reduce the number of rules by half (or more).
For example, using the above two URLs after removing the 'fragment identifiers' we can use mod_rewrite to do an internal rewrite like this:
RewriteRule ^_(english¦francais)/fil/fil_5/fil_5a_([ef])\.htm /index_$2.php?s1=idf-fil&s2=codex&page=rep-rap [L]
Here, the "$2" in the substitution URL on the right back-references either an "e" or an "f", as captured using the "([ef])" subpattern in the second parenthesized regular-expressions sub-pattern on the left. (You will need to replace the broken pipe "¦" character in the first sub-pattern with a solid pipe before use; Posting on this forum modifies the pipe character.)
You may also be able to take advantage of other 'regularities' in the URLs you are rewriting, to use one rule for several (or many) URLs.
As mentioned, this code does not do a URL-to-URL external redirect; It simply maps requests for the friendly URLs to the internal filepaths needed to generate the proper page content.
[edit] Amended per the following post to prevent propagation of bad code. :o [/edit]
Jim
[edited by: jdMorgan at 8:16 pm (utc) on Jan. 21, 2009]