Current location: Hot Scripts Forums » Other Discussions » Web Servers » .htaccess 301 redirect


.htaccess 301 redirect

Reply
  #1 (permalink)  
Old 08-19-08, 07:31 AM
MikeW MikeW is offline
New Member
 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
.htaccess 301 redirect

Hello

I'm trying to redirect around 5 dynamic urls to subfolders but the script I'm using doesn't seem to work. See below.

Options +FollowSymLinks

RewriteEngine on
RewriteBase /
RewriteRule ^newfolder/ old-dynamic.php?catid=1 [R=301,L]

can anyone give me any ideas.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-20-08, 10:54 AM
curbview.com's Avatar
curbview.com curbview.com is offline
Junior Code Guru
 
Join Date: May 2006
Posts: 555
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MikeW View Post
Hello

I'm trying to redirect around 5 dynamic urls to subfolders but the script I'm using doesn't seem to work. See below.

Options +FollowSymLinks

RewriteEngine on
RewriteBase /
RewriteRule ^newfolder/ old-dynamic.php?catid=1 [R=301,L]

can anyone give me any ideas.
I don't see where you are trapping the original request. See below a real RewriteRule for an example:

RewriteRule ^([A-Za-z0-9]+)\/newfolder(\/)?$ old-dynamic.php?catid=$1 [R=301,L]
__________________
Whatever you decide, you should make sure best security methods are used and practiced. Should you really need more help, PM me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-29-08, 11:19 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
The first string in the rule is the original, the next is what you want it to be rewritten to.

Perhaps the following would work:

Code:
RewriteRule ^old-dynamic.php?catid=1 /newfolder [R=301,L]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-30-08, 05:40 AM
curbview.com's Avatar
curbview.com curbview.com is offline
Junior Code Guru
 
Join Date: May 2006
Posts: 555
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by wirehopper View Post
The first string in the rule is the original, the next is what you want it to be rewritten to.

Perhaps the following would work:

Code:
RewriteRule ^old-dynamic.php?catid=1 /newfolder [R=301,L]
You are giving the OP the wrong answer...! Study the question...
__________________
Whatever you decide, you should make sure best security methods are used and practiced. Should you really need more help, PM me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] .htaccess 301 redirect snaip Web Servers 12 03-09-08 11:15 AM
Really complex redirect 301 - need help! Josie ASP 2 07-08-06 05:22 PM
Permanent 301 Redirect to new Domain's URL giving me problems in .htaccess cebuy HTML/XHTML/XML 1 03-10-06 11:34 PM
.htaccess problem with new host SugarChick Web Servers 0 02-07-06 04:56 PM
.htaccess and PHP Redirect problem dodod PHP 3 06-19-05 11:56 PM


All times are GMT -5. The time now is 09:11 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.