iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Search Engine Optimization Forum SEO is much easier with help from peers and experts! The WebProWorld SEO forum is for the discussion and exploration of various search engine optimization topics. Any non (engine) specific SEO or SEM topics should go here.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2007, 12:17 PM
WebProWorld Pro
 
Join Date: Dec 2005
Posts: 220
crush123 RepRank 0
Exclamation Please tell me how to make 301 redirection of these links in this .htaccess file?

Hello,
I have a .htaccess file and this is the code:
-----------------------
RewriteEngine on
RewriteRule ^site/(.*)$ site.php?id=$1
RewriteRule ^downloads/(.*)$ search.php?keywords=$1
RewriteRule ^downloads/(.*)/(.*)$ search.php?keywords=$1_$2
RewriteRule ^download/(.*)/(.*)$ search.php?keywords=$1&page=$2
RewriteRule ^review/(.*)$ review.php?d=$1
RewriteRule ^edit/(.*)$ edit.php?d=$1
RewriteRule ^refer/(.*)$ refer.php?d=$1

IndexIgnore *

Redirect http://mysite.com/s/ http://mysite.com/s/create.php

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,L]
-----------------------------

( mysite.com is not my site. )

I have checked the links in a popular "search engine friendly redirect check
tool" and it shows that all my links are 302 and are not SE friendly.

I wish to make all these redirections 301.
I have placed [R=301] at the end of all the lines above, but it didn't
worked.

Please tell me how to make the links as 301 and search engine friendly.

Thanks a lot.

Last edited by crush123; 06-27-2007 at 01:47 PM.
Reply With Quote
  #2 (permalink)  
Old 06-27-2007, 01:06 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Please tell me how to make 301 redirection of these links in this .htaccess file?

The rewrites as you have them are considered internal. As a result, no redirection is done - the user or the search engine still sees the original URL, but the server displays a different page. So just to give one example of a change to make it a 301 redirect

Original Version:
Code:
 RewriteRule ^downloads/(.*)$ search.php?keywords=$1
301 Redirect Version
Code:
 RewriteRule ^downloads/(.*)$ http://www.mysite.com/search.php?keywords=$1[R=301]
There is a second way, which is supposed to be more efficient in the server code
Code:
 RedirectMatch 302 ^downloads/(.*)$ http://www.mysite.com/search.php?keywords=$1
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #3 (permalink)  
Old 06-27-2007, 02:22 PM
WebProWorld Pro
 
Join Date: Dec 2005
Posts: 220
crush123 RepRank 0
Default Re: Please tell me how to make 301 redirection of these links in this .htaccess file?

Hello wige,
I wish all the links of my pages to be 301 redirects.

when I check for example :
Software - 1 to 10 of 694 Downloads
it is giving 302 status rather than 301

same case with other redirections in the .htaccess

So, somebody please tell me how to make all my links to show 301
Thank you

Last edited by crush123; 06-27-2007 at 02:32 PM.
Reply With Quote
  #4 (permalink)  
Old 06-27-2007, 05:40 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Please tell me how to make 301 redirection of these links in this .htaccess file?

Quote:
Originally Posted by crush123 View Post
This line needs to be changed to Redirect 301 /s/ http://mysite.com/s/create.php
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #5 (permalink)  
Old 06-30-2007, 03:03 PM
Webnauts's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Aug 2003
Location: Worldwide
Posts: 8,164
Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9
Default Re: Please tell me how to make 301 redirection of these links in this .htaccess file?

Maybe you can find some tips on the tutorial I published recently:
SEO Workers Tutorial: Search Engine Friendly Permanent Redirects
__________________
"Being an expert isn't telling other people what you know. It's understanding what questions to ask, and flexibly applying your knowledge to the specific situation at hand. Being an expert means providing sensible, highly contextual direction." Jeff Atwood
SEO Workers - Search Engine Optimization Consulting Company | SEO Analysis Tool | Webnauts Net SEO
Reply With Quote
  #6 (permalink)  
Old 06-30-2007, 06:17 PM
WebProWorld New Member
 
Join Date: Mar 2006
Posts: 19
magic42 RepRank 0
Default Re: Please tell me how to make 301 redirection of these links in this .htaccess file?

Pls excuse my ignorance, but what exactl is a "301 redirect". I keep hearing about it, but don't really know what it is.

Thanks

magic42
Reply With Quote
  #7 (permalink)  
Old 06-30-2007, 06:26 PM
incrediblehelp's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Jan 2004
Location: Live in Cincy Now
Posts: 7,573
incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4
Default Re: Please tell me how to make 301 redirection of these links in this .htaccess file?

301 redirect - Google Search
Reply With Quote
Reply

  WebProWorld > Search Engines > Search Engine Optimization Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help regarding .htaccess file SES Trims Search Engine Optimization Forum 1 12-26-2006 08:48 PM
help regarding .htaccess file SES Trims Google Discussion Forum 3 12-08-2006 06:59 PM
a .htaccess question (redirection) effisk Web Programming Discussion Forum 20 09-02-2005 01:11 PM
.htaccess redirection mantawebsolutions Search Engine Optimization Forum 7 09-09-2004 07:18 AM
.htaccess file creation help... please WebCraft Web Programming Discussion Forum 3 10-28-2003 09:26 PM


All times are GMT -4. The time now is 05:06 AM.



Search Engine Optimization by vBSEO 3.3.0