Instant $10 by paypal - URL Re-writing-301 redirect error help needed

7 replies
Need a little help with URL redirection. Instant $10 by paypal to the first person who solves this for me

A page of my website goes like this:
Code:
www.domain.keyword2-keyword1.html
Now, I want to rewrite it as follows:
Code:
www.domain.keyword1-keyword2.html
I did this by adding this code to my .htaccess file:
Code:
RewriteRule (.*)keyword1-keyword2.html  keyword2-keyword1.html
At this stage, the page loads both by entering the old as well as the new URL
Now the old URL had about 100+ backlinks and PR of 1 which I didn’t want to lose. So I used a simple 301 redirect to transfer the old URL’s PR and link juice to the new re-writen URL as follows:
Code:
Redirect 301 /old.html http://www.domain.com/new.html
At this stage the trouble begins.
When I enter the new URL, the page just redirects to the home page. And when I enter the old URL into the browser, or navigate to the page by clicking on the link on the website, the page loads but the URL is shown as follows:
Code:
http://www.domain.com/keyword1-keyword2.html?URL=keyword1-keyword2
Obviously there is something wrong with it. So my question this - how do I first re-write a URL and then 301 redirect the old URL to the new one? Or is it the wrong way of doing this?
#$10 #error #instant #needed #paypal #redirect #rewriting301 #url
  • Profile picture of the author supersonic
    Hello,
    1. If you want to redirect all of your visitors who visit at your OLD URL to NEW URL and...
    2. Have no problem with the new URL (like domain.keywordx.keywordy.com)
    Then, I can help you. PM me and I can solve this problem for $15.

    Thanks
    {{ DiscussionBoard.errors[4272765].message }}
  • Profile picture of the author online4cash
    Just Simple Go Through Your Cpanel Hosting Account and select Redirect then redirect your New Domain Name Through Old Or Old Domain name Through new Whatever You Want..!!
    Simple.....!!
    {{ DiscussionBoard.errors[4273427].message }}
  • Profile picture of the author Matt Ward
    RewriteRule ^keyword1-keyword2\.html /keyword2-keyword1.html [R=301,L]

    If that doesn't work, write out the full address for the second one like

    RewriteRule ^keyword1-keyword2\.html http://www.domain.com/keyword2-keyword1.html [R=301,L]
    Signature
    "Keep moving forward."
    {{ DiscussionBoard.errors[4273485].message }}
  • This would be the appropriate place to hire someone for the services Warriors For Hire

    And it is very easy to put 301 redirect and your web host can also do this for you for free.

    Lawrence
    Signature
    We're Getting Page 1 Rankings For All Of Our Clients. Our Own Lead Generation Sites Are Generating Over 100 Leads Per Day. We Get Results. BUT We're NOT Cheap! Do YOU Want To Hire Us? SEO Company
    {{ DiscussionBoard.errors[4273511].message }}
  • Profile picture of the author h0ms
    Code:
    RewriteEngine on
    
    
    RewriteRule ^keyword1-keyword2.html$ http://www.yourdomain.com/keyword2-keyword1.html [L,R=301]
    This should always work. Copy the code exactly and test.
    Keep in mind how you have your site indexed... as http://domain.com or as http://www.domain.com. You want the rewrite to resemble url that's already indexed.
    {{ DiscussionBoard.errors[4273553].message }}
    • Profile picture of the author EliteIM
      Originally Posted by mattward View Post

      RewriteRule ^keyword1-keyword2.html /keyword2-keyword1.html [R=301,L]

      If that doesn't work, write out the full address for the second one like

      RewriteRule ^keyword1-keyword2.html http://www.domain.com/keyword2-keyword1.html [R=301,L]
      I tried both and it did not worked out. If I enter the old URL, then it simply loads without showing the new, rewritten URL. And when I enter the new URL it just redirects to the homepage.

      Originally Posted by h0ms View Post

      Code:
      RewriteEngine on
      
      
      RewriteRule ^keyword1-keyword2.html$ http://www.yourdomain.com/keyword2-keyword1.html [L,R=301]
      This should always work. Copy the code exactly and test.
      Keep in mind how you have your site indexed... as http://domain.com or as http://www.domain.com. You want the rewrite to resemble url that's already indexed.
      I tried this and got this error:

      This page has too many loops and cannot be displayed
      {{ DiscussionBoard.errors[4274436].message }}
  • Profile picture of the author EliteIM
    Just to give a clear picture, this is what my HTACCESS file looks like BEFORE making any changes: ("domain" has been used in place of actual domain name for security reasons)

    AddHandler application/x-httpd-php5s .php

    rewriteengine on
    rewritecond %{HTTP_HOST} ^domain.com$
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    RewriteRule admin/index.php/$ admin/index.php

    RewriteRule (.*)testn.html testn.html
    RewriteRule (.*)index.html index.php
    RewriteRule (.*)contact-us.html contact-us.php
    RewriteRule (.*)sitemap.html sitemap.php
    {{ DiscussionBoard.errors[4279757].message }}

Trending Topics