Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Subscribe to WebmasterWorld
301 redirect including url parameters 301, redirect jamalwalsh msg:4477307 10:01 pm on Jul 19, 2012 (gmt 0) Hello I need to redirect some sub directories of a site by identifying parameters in the URL I have several urls I need to 301 redirect to a different site permenatly EXAMPLE I would like to redirect 301 the following URLs www.example.com/test/Z_InitLoginPcode.do?country=GB&language=EN www.example.com/test/Z_InitLoginPcode.do?country=DE&language=DE www.example.com/test/Z_InitLoginPcode.do?country=FR&language=FR There's also the following URL that I want to stay where they are. www.example.com/test/Z_InitLoginPcode.do?country=ES&language=ES www.example.com/test/Z_InitLoginPcode.do?country=CH&language=DE www.example.com/test/Z_InitLoginPcode.do?country=CH&language=FR And I would like the redirect to go to www.newexample.net HELP! Please...
lucy24 msg:4477402 6:31 am on Jul 20, 2012 (gmt 0)
Read the last few posts in this Forum. It can't be much more than 24 hours since I last posted the boilerplate on query strings (parameters). That will be your starting point. lc4seo msg:4477486 12:46 pm on Jul 20, 2012 (gmt 0)
Since you want to leave some pages in the /test/ directory you will have to 301 all pages individually on the .htaccess that you want to redirect: RewriteRule ^test/page-to-keep$ [ ...] [R=301,L] newsite.com If you wanted to just 301 the entire directory and add new pages for the ones you want to keep you could use the following: Rewriterule ^test/(.*) [ ...] [R=301,L] newdomain.com g1smd msg:4477488 1:15 pm on Jul 20, 2012 (gmt 0)
Bill. You added a sticky thread a few months ago asking people to use example.com in this forum so that URL auto-linking would be suppressed. Since that request was posted only three or four people have managed to comply with it.
lucy24 msg:4477637 9:50 pm on Jul 20, 2012 (gmt 0)
But the OP was one of them-- unless Bill was in a hurry and didn't have time for the "thread tidy" boilerplate-- so let's be nice to him ;) Just noticed that if you are starting a new topic in this forum, the Sticky will also be visible at the bottom of the screen in the "This Forum: Newer" spot. lc, he will have to look at the query string, because that's the significant variable. A conditionless Rule won't work. (France and Germany come with him; Swizerland stays put. Heh.) jamalwalsh msg:4477751 7:30 am on Jul 21, 2012 (gmt 0)
Lucy, you're correct that's exactly what I need to do.