redirect .. stupid and basic question but I don't know how to fix it

Hi there I have my site up and running, and works fine, the redirect works, but if I create a folder works, but takes me back to the homepage. I’ve checked the htaccess and nothing caught my attention there

Any ideas how to fix that? Sorry for being so basic but all the articles I’ve been reading are mostly chinese for me :(

I have a droplet running Ubuntu 20.04, apache, mysql, php and couple other things in case that helps

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Thank you Alex ! I forgot to mention, looking to simplify the explanation, that “folder” was an example, the folder name is a name the system creates for each registered user, so is dynamic, I have just a few users now, but hope to get more, so I have no idea how to fix that for now and the future. Trying to get a hold of the person that developed the php script I’m using, maybe he can help.

Hello, @puntadigital

Could you please confirm that you would like to redirect to but also to have without redirecting back to

If you want to redirect to you can use this .htaccess rule:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{REQUEST_URI} ^/folder/
RewriteRule ^(.*)$$1 [R=301,L]

Hope that this helps! Regards, Alex