Can Document change using .htaccess on server

Description of your first forum.
Post Reply
Oliviajohnson
Posts: 11
Joined: Mon Dec 29, 2014 3:32 pm

Can Document change using .htaccess on server

Post by Oliviajohnson » Mon Dec 29, 2014 3:41 pm

Hi Friends, Can I change my document root folder on server using .htaccess file? Please help me .

Brown
Posts: 8
Joined: Mon Dec 29, 2014 4:44 pm

Re: Can Document change using .htaccess on server

Post by Brown » Wed Jan 21, 2015 10:18 am

Yes, you can Document change using .htaccess on server.

freyacooper
Posts: 16
Joined: Thu Jan 22, 2015 4:01 pm

Re: Can Document change using .htaccess on server

Post by freyacooper » Thu Apr 09, 2015 10:11 am

The document root is the directory where the application will begin looking for your .php files.
To change the document root, you may supply the path to the directory (relative to your application root directory) as an argument to the boot script.
It is not necessary to change configuration files or rewrite rules to define the document root.

williamnicholas240
Posts: 10
Joined: Thu Jan 22, 2015 5:15 pm

Re: Can Document change using .htaccess on server

Post by williamnicholas240 » Tue Nov 16, 2021 5:11 am

On a Windows server, htaccess rules will not operate. However, there are two options for accomplishing this. Create the rules for your website or web application's config file.

ethanmoore74
Posts: 13
Joined: Wed Jan 21, 2015 5:07 pm

Re: Can Document change using .htaccess on server

Post by ethanmoore74 » Wed Dec 22, 2021 4:41 am

If you want to store your website files in a subdirectory but don't want the directory to show up in the URL, use the following code:
1. In your public html folder, edit the .htaccess file.
See How to Edit Your .htaccess File for more information.
2. At the beginning of your .htaccess file, add the following code, substituting example.com and directory with your information.
3. Make a backup
Your website files will be provided from your subdirectory when you visit your domain.

ethanmoore74
Posts: 13
Joined: Wed Jan 21, 2015 5:07 pm

Re: Can Document change using .htaccess on server

Post by ethanmoore74 » Wed Dec 22, 2021 4:43 am

If you want to store your website files in a subdirectory but don't want the directory to show up in the URL, use the following code:

1. In your public html folder, edit the.htaccess file.
See How to Edit Your.htaccess File for more information.
2. At the beginning of your.htaccess file, add the following code, substituting example.com and directory with your information.
3. Make a backup
Your website files will be provided from your subdirectory when you visit your domain.

Post Reply