close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

301 redirect

Thread began 3/21/2016 12:33 pm by Jamie | Last modified 3/22/2016 3:26 pm by Ray Borduin | 859 views | 6 replies |

Jamie

301 redirect

Hi Ray

Have got an .htaccess that is re-writing

RewriteRule ^product/(.*)$ product-item.php?perm=$1 [NC,L,QSA,T=application/x-httpd-php]



The client changed the page name thereby changing the url.

I have tried to set up a 301 to take a visitor from the old URL to the new one but cannot get it to work.

Basically I have this:

Redirect 301 /product/original-url http://www.domainname.com/product/new-url

but when go to the original url, the url looks like this and the page doesnt resolve:
http://www.domainname.com/product/new-url?perm=original-url

Not sure how to fix that?

Cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

can I see a copy of your .htaccess file? You will need to add the 301 redirect before the perm rewrite. This might just be an issue with the order?

I'd do the 301 redirect with a rewrite rule instead like:
^product/original-url/?$ product/new-url [NC,L,R=301,QSA,T=application/x-httpd-php]

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

have tried both position and using the rewrite as you suggest but both are resulting in exactly the same as before: http://www.domainname.com/product/new-url?perm=original-url

have attached the .htaccaess file

Sign in to reply to this post

Ray BorduinWebAssist

I'm at a loss... are you sure you didn't add code to the page itself that might be causing the issue?

Try removing the ,QSA part of the new redirect... that should make it remove any query string variables.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

I've tried that, have moved the reqrites around in all possible combinations, tried it as RewriteRule ^product/fibre-optic-curing-systems\$ "http\:\/\/www\.domain\.com\/product\/field\--in-situ\-curing\-system\" [R=301,L] and none of them work....

Have attached the front end page... the only thing I can think of is the base href reference but thats needed to reference the right path....

Sign in to reply to this post

Ray BorduinWebAssist

How about we do it on the page instead of in the .htaccess....

Remove the redirect from the .htaccess file and just add this to the top of the page itself.

php:
<?php

if (isset($_GET['perm']) && $_GET['perm'] == "fibre-optic-curing-systems") {
  
header("HTTP/1.1 301 Moved Permanently");
  
header("Location: http://www.domain.com/product/field--in-situ-curing-system"); 
}
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

thats done it!

Thanks Ray

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...