0
Welcome Guest! Login
0 items Join Now

Trying to redirect using 301 in htaccess

    • Rakesh's Avatar
    • Rakesh
    • Sr. Rocketeer
    • Posts: 166
    • Thanks: 0

    Trying to redirect using 301 in htaccess

    Posted 16 years 2 weeks ago
    • prim's Avatar
    • prim
    • Preeminent Rocketeer
    • Posts: 17290
    • Thanks: 217

    Re: Trying to redirect using 301 in htaccess

    Posted 16 years 2 weeks ago
    • Maybe not a good solution but can you disable SEF and manually copy the link you want to change?
    • Please reply with a direct link to the issue & create a new thread for each new issue.

      A template is only as good as the content that goes into it ;) - DanG
    • Rakesh's Avatar
    • Rakesh
    • Sr. Rocketeer
    • Posts: 166
    • Thanks: 0

    Re: Trying to redirect using 301 in htaccess

    Posted 16 years 2 weeks ago
    • I dont think I would be able to see the old URL if I did that unless the non-sef URL doesnt change?
    • Rakesh's Avatar
    • Rakesh
    • Sr. Rocketeer
    • Posts: 166
    • Thanks: 0

    Re: Trying to redirect using 301 in htaccess

    Posted 15 years 11 months ago
    • To get my htaccess file to work I did the following. I run the site on Windows so this may not be applicable to linux hosts. I also use sh404sef.

      In .htaccess add

      ######## Start Domain redirection
      ## This code redirects NON-WWW URLs to WWW URLs
      ## This helps prevent duplicate content
      RewriteCond %{HTTP_HOST} !^www\.yoursapna\.com
      RewriteRule (.*) www.yoursapna.com/$1 [R=301,L]
      ######## END Redirect domain redirection

      In httpd.conf uncomment mod_rewrite

      In httpd.conf add AccessFileName .htaccess

      In httpd.conf check and amend;

      <Directory "C:/Web/Sites/www.yoursapna.com">
      Options All
      Allow from All
      Order Allow,Deny
      AllowOverride All
      </Directory>

      In Joomla, enable mod_rewrite and SEF URLs - you need this even if you run sh404sef.

      sh404sef redirect non-www to www domain name does not work. The above solution fixes this.

Time to create page: 0.060 seconds