Forum Moderators: phranque

Message Too Old, No Replies

A small problem with my .htaccess file and .301 redirects.

301 makes a strange addition to the redirected URL ...

         

JackR

6:14 pm on Jan 31, 2006 (gmt 0)

10+ Year Member



I'm currently using the following .htaccess file:


RewriteEngine on
RewriteBase /
RewriteRule ^sitemapdb.xml$ /cgi-bin/friends.cgi?a=sMX [NC,L]
RewriteRule ^London_friends_portfolio.htm$ /cgi-bin/friends.cgi?a=g [NC,L]
RewriteRule ^london_friends/[^\.]+.([0-9]+).([0-9]+).htm$ /cgi-bin/friends.cgi?a=p&g=$1&id=$2 [NC,L]
RewriteRule ^sitemap.html$ /cgi-bin/friends.cgi?a=sM [L]
RewriteRule ^terms_conditions.htm$ /cgi-bin/friends.cgi?a=t [L]
RewriteRule ^links.htm$ /cgi-bin/friends.cgi?a=lP [L]
RewriteRule ^joinus.htm$ /cgi-bin/friends.cgi?a=j [L]

RedirectMatch permanent ^/$ http://www.example1.com

Redirect 301 /London_friends_portfolio.htm http://www.example1.c..._portfolio.htm
Redirect 301 /terms_conditions.htm http://www.example1.c...conditions.htm
Redirect 301 /joinus.htm http://www.example1.com/joinus.htm
Redirect 301 /links/index.html http://www.example1.com/links/index.htm

-The problem is that two of the redirects are producing strange URL extensions:

http://www.example.ws/London_friends_portfolio.htm
redirects to:
http://www.example1.c...tfolio.htm?a=g

and:

http://www.example.ws/joinus.htm
redirects to:
http: //www.example1.com/joinus.htm?a=j

-What are the?a=g and?a=j extensions - and how do I get rid of them?

Please help if you can.

[edited by: jdMorgan at 6:59 pm (utc) on Jan. 31, 2006]
[edit reason] No URLS, please. See Terms of Service. [/edit]

jdMorgan

7:00 pm on Jan 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your second and seventh RewriteRules clearly add these query parameters, so I'm not sure what your question is...

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim

JackR

7:19 pm on Jan 31, 2006 (gmt 0)

10+ Year Member



Thanks for the reply. To clarify, I only added the 4x 301s to the file - the Rewrite rules were already there. Can you please tell me what to edit/remove to ensure that the URLs are correct - without the query parameters.

jdMorgan

8:24 pm on Jan 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd suggest that you remove "?a=g" and "?a=j" from the two RewriteRules I cited.

Jim

JackR

8:41 pm on Jan 31, 2006 (gmt 0)

10+ Year Member



Thank you jdMorgan - problem now resolved.