0
Welcome Guest! Login
0 items Join Now

SOLVED Htaccess 301 redirect

  • SOLVED Htaccess 301 redirect

    Posted 13 years 1 month ago
    • Basiclly what i wanna do is to point all the old links from the old website to the new link on the new site.

      example:

      old url looks like:
      www.naturcraft.se/naturcraft.asp?avdelning=2

      I want to point that to
      www.naturcraft.se/privatpersoner

      www.naturcraft.se/naturcraft.asp?avdelning=1
      to
      www.naturcraft.se/foretag

      etc,

      Ive tried the following:
      adding
      RewriteCond %{QUERY_STRING} ^avdelning=2
      RewriteRule ^naturcraft.asp$ /privatpersoner/$1 [L,R="301"]
      In my .htaccess file

      but then i get the following link:
      www.naturcraft.se/privatpersoner?avdelning=2

      I want to remove the ?avdelning=2 from my new url :)

      Thanks in advance.
      System Information
      PHP Built On     Linux cl-web-05-12.atm.binero.net 2.6.18-338.19.1.el5.lve0.8.36 #1 SMP Wed Jul 27 13:20:06 EEST 2011 x86_64
      Database Version     5.1.61-0ubuntu0.10.04.1-log
      Database Collation   utf8_general_ci
      PHP Version  5.2.17
      Web Server   Apache
      WebServer to PHP Interface   cgi-fcgi
      Joomla! Version  Joomla! 2.5.3 Stable [ Ember ] 15-March-2012 14:00 GMT
      Joomla! Platform Version     Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT
      User Agent   Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19
    • Last Edit: 13 years 1 month ago by Christopher Hedqvist.
  • Re: SOLVED Htaccess 301 redirect

    Posted 13 years 1 month ago
    • Solved by adding:

      RewriteCond %{QUERY_STRING} ^avdelning=2
      RewriteRule ^naturcraft.asp$ /privatpersoner/$1? [L,R="301"]

      instead of

      RewriteCond %{QUERY_STRING} ^avdelning=2
      RewriteRule ^naturcraft.asp$ /privatpersoner/$1 [L,R="301"]

Time to create page: 0.057 seconds