I have a URL https://facebook.****.in, set up to point at a directory /var/www/html/facebook_app. the virtual hosts file for this is /etc/apache2/sites-available/facebook.****.in.conf.
I would like to add a path to the URL which points to another custom directory such that,
https://facebook.****.in/apis -> /var/www/html/apis
I searched this forum and found some solution here
But I'm not sure where should i add the alias to? should it be the default.conf? or the facebook.****.in.conf file.
If it is facebook.****.in.conf file, how should i specify the alias? I would like to host it on 443 port for SSL.
facebook.****.in.conf file:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName facebook.****.in
ServerAlias facebook.****.in
DocumentRoot /var/www/html/facebook_app/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName facebook.****.in
ServerAlias facebook.****.in
DocumentRoot /var/www/html/facebook_app/
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
SSLCertificateFile /etc/apache2/ssl/facebook_****_in.crt
SSLCertificateKeyFile /etc/apache2/ssl/facebook.****.in.key
SSLCertificateChainFile /etc/apache2/ssl/facebook.****.in.ca-bundle
</VirtualHost>
here's the .htaccess file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
I have an index.php file which maps the url parameters to classes and methods.
ProxyPass
, if this is another dir on the same machine you can symlink to it, the first option would probably beProxyPass
as explained here (useful for running services on different ports as a unified service): confluence.atlassian.com/doc/…