close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

htaccess redirect

Thread began 8/08/2016 8:58 am by Jamie | Last modified 8/16/2016 5:25 pm by Ray Borduin | 241 views | 11 replies |

Jamie

htaccess redirect

Hey Ray

Just wondering if you might have any insight as to why, on the .htacces file, this 301 works fine:

Redirect 301 /wp-config.php http://www.fbi.gov/


but this one doesnt:

Redirect 301 /article/avoptics-to-provide-optical-harnesses-for-general-dynamics-land-systemsuk-for-ares-variant-of-the-a /http://www.avoptics.com/article/avoptics-to-provide-optical-harnesses-for-general-dynamics-land-systemsuk-for-ares-variant-of-the-aj/



the rewrite that is being used on the latter is

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



If you go to the page that is being redirected ( http://goo.gl/mOlsT5 ), it is adding ?perm=avoptics-to-provide-optical-harnesses-for-general-dynamics-land-systemsuk-for-ares-variant-of-the-a to the correct url

Have attached the php page itself

TIA

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

Add [L] to the end of the htaccess redirect. That tells it to not keep processing rules lower down on the file.

Sign in to reply to this post

Jamie

Have tried putting [L] after a single line of redirects, after all the redirects and also at the end of the htaccess file and with all of them I get a 500 error

Sign in to reply to this post

Ray BorduinWebAssist

Can I see a copy of the .htaccess file?

Sign in to reply to this post

Jamie

sure, here you go

Sign in to reply to this post

Ray BorduinWebAssist

Move the redirect rule you want to have precedence above the one you don't want running.

Try moving lines 20-25 down below line 94

Sign in to reply to this post

Jamie

'fraid it hasnt made a difference :(

its still appending ?perm=permalink of the page being redirected in the uri

Sign in to reply to this post

Ray BorduinWebAssist

If you give me FTP access I'll try playing with it a bit, but I don't know why that wouldn't work... maybe create a mod rewrite rule to catch that instance first and then redirect to a new page that then triggers the 301 redirect.

Sign in to reply to this post

Jamie

thanks Ray thats really kind :) please dont waste too long on it as it isnt hugely important. The odd thing is that none of the redirects, after the first one, dont work.

details in PM and files attached

Sign in to reply to this post

Ray BorduinWebAssist

It looks like it will work if you use a RewriteRule for your 301 redirect instead of using the Redirect 301 syntax.

I've updated the first one. (remember your 301 redirect will be cached so you may need to clear your browser cache or use a different browser to see it work)

Sign in to reply to this post
loading

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...