Search Engine Optimization
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignSearch Engine Optimization

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 8th, 2008, 04:22 AM
WeXXL's Avatar
WeXXL WeXXL is offline
Awake and listening...
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Berlicum, the Netherlands
Posts: 127 WeXXL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 7 h 34 m 37 sec
Reputation Power: 8
Editing .htaccess, 301 redirect link with variables

I want to redirect an old page (http://www.website.com/page.php?id=47) to a new page (http://www.website.com/redirectpage/). For some reason the code I used does not work. My rewrite engine does work, because other RewriteRules work correctly.

What can I do to fix this problem?

PHP Code:
 RewriteEngine On

RewriteBase 
/
RewriteRule ^page.php?id=47(.*)$ /redirectpage/$[R=301,L
__________________
People who get a raise because of their good work have been underpayed for quite some time.

Reply With Quote
  #2  
Old October 12th, 2008, 07:55 PM
jazajay jazajay is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 336 jazajay User rank is Sergeant (500 - 2000 Reputation Level)jazajay User rank is Sergeant (500 - 2000 Reputation Level)jazajay User rank is Sergeant (500 - 2000 Reputation Level)jazajay User rank is Sergeant (500 - 2000 Reputation Level)jazajay User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 6 h 16 sec
Reputation Power: 9
It's not working because you are setting the variable on the url you want to mask and not the main url that is shown to the user.
Try -
PHP Code:
 RewriteEngine On 
RewriteBase 

RewriteRule ^p-(.*)$ /page.php?id=$[R=301,L


So if you entered in yoursite.com/p-47

it would be the same as entering in yoursite.com/page.php?id=47

That is assuming that the .htaccess file is in the root directory.

Jaz

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignSearch Engine Optimization > Editing .htaccess, 301 redirect link with variables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT