can I have .htaccess on shared linux server

rgb192
rgb192 used Ask the Experts™
on
previous answer to
https://www.experts-exchange.com/questions/29117145/non-www-version.html

If you mean what I think you do, you can set up a .htaccess file to do this. In there, you can create a rule to redirect users to a specific url. So, if they type in www.yoursite.com it will redirect to http://yoursite.com

can I do this with my server
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fractional CTO
Distinguished Expert 2018
Commented:
Almost every shared server system allows access to .htaccess files.

Likely you'll access your .htaccess through SFTP.

Note: Best to first make a backup copy, before making changes as any minor .htaccess syntax error in the site's DocumentRoot, will take down entire site... meaning... entire site will throw a 500 Internal Server error.
Dr. KlahnPrincipal Software Engineer
Commented:
can I do this with my server

If the server is Apache or Apache-based, yes.

However, for a rule that is to be applied on all URLs, it is (imo) better to apply it in httpd.conf, not in .htaccess.

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial