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

Posted January 9, 2021 269 views

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

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.

Submit an Answer
2 answers

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!

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.