0

So I asked this question before but got none working answer, maybe I defined it in a wrong way.

My question is: How can I remove all / urls from my link. So for example: the URL right now is: exampledomain.com/a/dashboard.html But I want it to be: exampledomain.com/ and nothing after it. So basicly nothing after the example.com/. Is that possible? I guess it has to be done in the .htaccess file but couldnt find a working rule.

So now it is: exampledomain.com/a/dashboard.html But I want it to be: exampledomain.com & nothing behind that / when u go to the dashboard.

Thanks for your help

tevemadar
  • 12,389
  • 3
  • 21
  • 49
  • 7
    Possible duplicate of [.htaccess remove all /example from website](https://stackoverflow.com/questions/51443879/htaccess-remove-all-example-from-website) – Dawid Zbiński Jul 29 '18 at 09:25
  • Yes you might use htaccess for redirection, check the following questions https://stackoverflow.com/questions/5730092/how-to-remove-html-from-url https://stackoverflow.com/questions/10676547/trouble-removing-html-url-extension-using-htaccess?rq=1 https://stackoverflow.com/questions/5730092/how-to-remove-html-from-url/5730126#5730126 More about .htaccess https://httpd.apache.org/docs/current/howto/htaccess.html You might also use whatever your back-end code to redirect to proper url – Anddo Jul 29 '18 at 09:27

1 Answers1

0

You can try the below rule in .htaccess

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/$
RewriteRule .* / [L,R=302]
Rohit.007
  • 3,414
  • 2
  • 21
  • 33