How to add /fr subdomain / allow access to it?

Hello.
I remade my site this time in two languages, and I want the user can access the site in french just by clicking on a button which brings him to http://mydomain.rf.gd/fr, bu that does not work.
It’s written “403 forbidden”

My website URL is: http://anthony-e-b.rf.gd

I just made a new folder like this :

Please help me ! (and sorry for my bad english)

What are the contents of your .htaccess file in the htdocs folder?

ErrorDocument 400 http://anthony-e-b.rf.gd/400.html
ErrorDocument 401 http://anthony-e-b.rf.gd/401.html
ErrorDocument 403 http://anthony-e-b.rf.gd/403.html
ErrorDocument 404 http://anthony-e-b.rf.gd/404.html
ErrorDocument 503 http://anthony-e-b.rf.gd/503.html
Header set Cache-Control “max-age=0, no-cache, no-store, must-revalidate”
Header set Pragma “no-cache”
Header set Expires “Wed, 11 Jan 1970 00:00:00 GMT”
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ $1.html [NC,L]

I suggest also to add this line of code before RewriteRule on your .htaccess file:

RewriteCond %{REQUEST_FILENAME} !-d
1 Like

Unfortunately, that changed nothing.

Forget that, It worked ! Thanks you a lot ! But when I type http://anthony-e-b.rf.gd/fr it doesn’t go to index.html file… So I guess i have to redirect to http://anthony-e-b.rf.gd/fr/index ?

1 Like

I don’t know, but you can try.

It works, but that’s not really convenient…
Do I have to create a new .htaccess in /fr folder to make that work ?

What are the contents of the .htaccess file in the /fr folder (if that file exists)?

That file do not exist, but I tried to put that :

DirectoryIndex index.php index.html index.htm index2.html

into it and it changed nothing.

For me it did redirect to index.html/index.html/index.html/index.html/index.html/index.html/index.html/ and again repeats, stopping the redirect after a point now. Did you try to use the “Redirects” tool to do this? If yes remove that redirect immediately, because it’s buggy.

I removed it from the htaccess of my htdocs main folder.
have you an idea of how could I do that ?

I tried to correct your .htaccess previous code with the following one:

ErrorDocument 400 http://anthony-e-b.rf.gd/400.html
ErrorDocument 401 http://anthony-e-b.rf.gd/401.html
ErrorDocument 403 http://anthony-e-b.rf.gd/403.html
ErrorDocument 404 http://anthony-e-b.rf.gd/404.html
ErrorDocument 503 http://anthony-e-b.rf.gd/503.html
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1970 00:00:00 GMT"
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [NC,L]

That don’t work.

The only thing that don’t work is the redirection of anthony-e-b.rf.gd/fr to anthony-e-b.rf.gd/fr/index.html, the directory index.

It work for the root htdocs folder but not for this subfolder…

For me it works now with that htaccess code. If you have problems, clear your browser cache.

Yeah !
Thank you a lot !! It work !
You’re saving me

Have a nice day

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.