Tell apache to point to a subfolder as default starting point for public

Tell apache to point to a subfolder as default starting point for public - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Tell apache to point to a subfolder as default starting point for public error on your web browser. Problem :


What would be the different methods of telling Apache to serve up httpdocs/public instead of httpdocs as the default starting point?



I want to be able to have my includes and logs directories behind the publicly accessible folder.



I know that htaccess is possible, but I've seen a file before that looked something like httpdocs => public ... I could be off, but it was some kind of pointer.



[httpdocs]
-[includes]
-[logs]
-[public] <-- what's served up to the public
--index.php

Solution :

In your Apache configuration file, find a line with 'DocumentRoot' and modify accordingly.



EDIT:



Regarding your comment, then you're looking for this:



DocumentRoot httpdocs/public/



Though for the virtual-hosts request,



<VirtualHost *:80>
ServerAdmin webmaster@sitename.com
ServerName www.sitename.com
DocumentRoot /var/www/sitename #STILL DOCUMENTROOT!!!
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/sitename/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/error_sitename.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access_sitename.log combined

</VirtualHost>


Though note still, it uses the DocumentRoot directive. You can have as many sites as you want. Modify the paths to match the httpdocs/public directory, and I assume that inside /public/ there will be directories for other virtual hosts?



If this isn't what you wanted, please re-phrase your question.


We hope that this article has helped you resolve the apache, htaccess, redirects error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How do I redirect traffic only if being accessed from a specific port?

DNS entry to redirect constant url to changing directory name

How to redirect to any domain [duplicate]