How do I move all traffic from one folder to the home page with htaccess redirect?

I am trying to set up a simple htaccess redirect, I want to move all traffic from one folder to the home page

I copied and pasted this code from another server that has been using it for years,

when I test it, i get a safari timeout error "Safari cant open page, too many redirects.."


this is my code, in a wordpress site, at bottom of .htacess below wordpress, toast, other plugins code

RewriteEngine On
Options +FollowSymLinks -Indexes

redirect 301 /mce_activity https://oala.ca/

Open in new window

LVL 1
jblayneyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle SantosSoftware Test Analyst I at Dassault SystemesCommented:
Hi,

I am following up on your question.  Do you still need help?

If you solved the problem on your own, would you please post the solution here in case others have the same problem?

Regards,

Kyle Santos
Customer Relations
jblayneyAuthor Commented:
this was never solved
Steve BinkCommented:
When I browse to "https://oala.ca/mce_activity", I do receive a 301 redirect to "https://oala.ca", with no errors.  This is in Chrome, Opera, and Edge.  In my old Safari for Windows, I get an error that a secure connection cannot be established with your server, but no redirection at all.
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Bernard SavonetCIOCommented:
Strange that this happens just with some browsers.
My suspects list would be
1 - browser cache
2 - browser
3 - vhost and https redirect

1 - clear browser cache and any cookie related to the site, then close browser, restart your computer, reopen it, test
If NOOK check with same browser from another machine, preferably that never went to the site

2 - check your safari setup for privacy and redirections. Have a look at https://www.techwalla.com/articles/how-to-prevent-redirects-in-safari or similar info

3 - check all lines in your htaccess
Check the vhost file for all redirections. Is there in the vhost or in the wordpress settings any redirection? A http redirect to https?

Good search!
Please post your tests results here.
Steve BinkCommented:
My secure error is probably a result of the old browser software - Apple stopped updating Safari for Windows quite some time ago.  The Safari results would be much more relevant if they could be reproduced in a more current environment (i.e., Safari on a Mac).

Since my first post, I also tested with Firefox, and I see the same behavior as with Chrome, Opera, and Edge.  From all appearances, this appears to be resolved.
Kyle SantosSoftware Test Analyst I at Dassault SystemesCommented:
jblayney,

Experts have responded.  Is there anything else we may assist you with?

Regards,

Kyle Santos
Customer Relations
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Important: Never do a 301, as browsers cache 301 requests for long periods. There's no RFC for how long 301s lodge in browser caches, so rarely are 301s correct to use.

Just know, once you use a 301 + have an error in your target link, you have to guess all visitors will have this error cached forever + will never see any change you make to your 301 target.
_______

How you do this depends on many factors. Most important relates to the mce_activity path component + if anything else will tack on the end of this directory, like other path components or query parameters.

Try this to only redirect the single path component + query parameters...
RewriteRule ^mce_activity/?$ https://oala.ca/?%{QUERY_STRING} [L,R=302]

Open in new window

To catch + pass additional path components will depend on exact format of source (mce_activity/...) format.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bernard SavonetCIOCommented:
David points to the essential part: redirect the query string as well... this would avoid most infinite loops!

Ooops... I wanted to post this comment just before closing the question... which is now delayed
jblayneyAuthor Commented:
Hello,

I cannot seem to pick a solution of this, I have tried a few times
Bernard SavonetCIOCommented:
Did you try the redirect as suggested by David?
jblayneyAuthor Commented:
It seemed to be a Safari caching issue, even after dumping and blocking cache, it just cleared up after 2 weeks..

his code also works
Bernard SavonetCIOCommented:
safari caching issue:
- this enforces David' suggestion
- did you test from another computer as I suggested? this might have pinpointed that the issue was not on "all Safaris"
jblayneyAuthor Commented:
yes, my phone and PC, can we close this please. I moved on from this project weeks ago
Kyle SantosSoftware Test Analyst I at Dassault SystemesCommented:
Hi jblayney,

You will have some options that look like this on your screen.
Screenshot_1.png
If you want to award experts points for their help you can select on their comments as 'No, but this was helpful'.
When you're done doing this, select the one comment as 'Yes, this is my solution!'

When you're all done with selections proceed with closing your question and you're done.

Let me know if you have any questions.

Regards,

Kyle Santos
Customer Relations
jblayneyAuthor Commented:
Yes I saw those, Like I posted already, I cannot click on those links, I tried many times. I am on Safari 11.1.1 on a Mac
Kyle SantosSoftware Test Analyst I at Dassault SystemesCommented:
I will get on a Mac and try to reproduce the issue you're having on Safari!  So sorry its not working for you.  I'll write back soon.
Kyle SantosSoftware Test Analyst I at Dassault SystemesCommented:
jblayney,

Thank you for reporting this issue.  It turns out there is a bug and we are going to fix it soon.  In the meantime, I have closed this question for you.  We appreciate your patience and understanding with us on this.  If you need anything else please let me know.

Regards,

Kyle Santos
Customer Relations
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.