Installing UAP to a Sub Directory? Read this first!
Views 656
Sweets 0
Images 0

4 years ago Topic

DaVaR
Offline
Administrator
Total Posts: 141
Joined: July 14, 2015
Posted: December 15, 2015 @ 06:00 PM
This is for those of you who would like to install UAP in a sub directory on your web server. First you will want to make sure that you have enabled .htaccess files on your apache server. If you open the apache config file look for the <Directory /var/www/> section. You should see something like this by default: Note: In this example we are installing the site to a sub directory named /uap2/. If yours differs, make sure to update it throughout.
Code
<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
		# Uncomment this directive is you want to see apache2\'s
		# default start page (in /apache2-default) when you go to /
		#RedirectMatch ^/$ /apache2-default/
</Directory>
Change the
Quote
AllowOverride None
to
Quote
AllowOverride ALL
(If the AllowOverride setting is not there, then you may add it.) The .htaccess files should not be enabled. To create an .htaccess file do the following: Open your text editor. Then save as .htaccess Make sure that the save as type is set to
Quote
All Types (*.*)
You will then want to copy the following into your .htaccess file:
Code
    RewriteEngine On
    #RewriteBase /uap2/
    RewriteRule ^([A-Za-z0-9\\_\\s]+)$ /uap2/index.php?page=$1 [QSA,L,NC]
    RewriteRule ^([A-Za-z0-9\\_\\s]+)/$ /uap2/index.php?page=$1 [QSA,L,NC]
    RewriteRule ^YummyAsPie/([A-Za-z0-9\\_\\s]+)/$ /uap2/index.php?page=admin/admin&adp=$1 [QSA,L,NC]
    RewriteRule ^YummyAsPie/locations/([A-Za-z0-9\\_\\s]+)/$ /uap2/index.php?page=admin/admin&adp2=$1 [QSA,L,NC]
    RewriteRule ^rp/([A-Za-z0-9\\_\\s]+)$ /uap2/index.php?rc_view=$1 [QSA,L,NC]
    RewriteRule ^rp/([A-Za-z0-9\\_\\s]+)/$ /uap2/index.php?rc_view=$1 [QSA,L,NC]
    RewriteRule ^member/([A-Za-z0-9\\_\\s]+)$ /uap2/index.php?profile=$1 [QSA,L,NC]
    RewriteRule ^member/([A-Za-z0-9\\_\\s]+)/$ /uap2/index.php?profile=$1 [QSA,L,NC]
    RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)$ /uap2/index.php?page=$1&pee=$2&fsp=$2 [QSA,L,NC]
    RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/$ /uap2/index.php?page=$1&pee=$2&fsp=$2 [QSA,L,NC]
    RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)$ /uap2/index.php?page=$1&pee=$2&fsp=$2&fsid=$3 [QSA,L,NC]
    RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/$ /uap2/index.php?page=$1&pee=$2&fsp=$2&fsid=$3 [QSA,L,NC]
    RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)$ /uap2/index.php?page=$1&pee=$2&fsp=$2&fsid=$3&fsid2=$4 [QSA,L,NC]
    RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/$ /uap2/index.php?page=$1&pee=$2&fsp=$2&fsid=$3&fsid2=$4 [QSA,L,NC]
On my server the styles are still broken, but the URLs work. You will then have to go in to the /models/design/ header.inc & footer.inc, and add the /uap2 directory to the stylesheet and java links. This is an option, but it is possible to break your site within your main directory. With all that said option 2 is to use Apache vhost like I do with my servers. Then you can have your site at uap2.yourwebsite.com rather than yourwebsite.com/uap2 Another option is to use apache\'s config to setup a sub directory. The code would look something like this:
Code
Alias /blog /var/www/uap2

<Directory /var/www/uap2>
    Options All
    AllowOverride All
    order allow,deny
    allow from all
</Directory>
If you go that route you should be able to use the default .htaccess settings I provided in the readme file.
Code
	RewriteEngine On
	RewriteBase /
	RewriteRule ^([A-Za-z0-9\\_\\s]+)$ /index.php?page=$1 [QSA,L,NC]
	RewriteRule ^([A-Za-z0-9\\_\\s]+)/$ /index.php?page=$1 [QSA,L,NC]
	RewriteRule ^YummyAsPie/([A-Za-z0-9\\_\\s]+)/$ /index.php?page=admin/admin&adp=$1 [QSA,L,NC]
	RewriteRule ^YummyAsPie/locations/([A-Za-z0-9\\_\\s]+)/$ /index.php?page=admin/admin&adp2=$1 [QSA,L,NC]
	RewriteRule ^rp/([A-Za-z0-9\\_\\s]+)$ /index.php?rc_view=$1 [QSA,L,NC]
	RewriteRule ^rp/([A-Za-z0-9\\_\\s]+)/$ /index.php?rc_view=$1 [QSA,L,NC]
	RewriteRule ^member/([A-Za-z0-9\\_\\s]+)$ /index.php?profile=$1 [QSA,L,NC]
	RewriteRule ^member/([A-Za-z0-9\\_\\s]+)/$ /index.php?profile=$1 [QSA,L,NC]
	RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)$ /index.php?page=$1&pee=$2&fsp=$2 [QSA,L,NC]
	RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/$ /index.php?page=$1&pee=$2&fsp=$2 [QSA,L,NC]
	RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)$ /index.php?page=$1&pee=$2&fsp=$2&fsid=$3 [QSA,L,NC]
	RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/$ /index.php?page=$1&pee=$2&fsp=$2&fsid=$3 [QSA,L,NC]
	RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)$ /index.php?page=$1&pee=$2&fsp=$2&fsid=$3&fsid2=$4 [QSA,L,NC]
	RewriteRule ^([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/([A-Za-z0-9\\_\\s]+)/$ /index.php?page=$1&pee=$2&fsp=$2&fsid=$3&fsid2=$4 [QSA,L,NC]
For more information about using the Alias approach go here: Apache Module mod_alias I also suggest reading this article: How to add custom directory e.g. phpmyadmin Hope this helps! Good luck and Enjoy! When all else fails, Google/Bing/Yahoo It!

Signature UAP v4.3.0 is Here!!!

Please keep questions and comments in the forum.

Forum Permissions
You cannot post in this forum.
You cannot moderate this forum.
You cannot administrate this forum.
Search Forums
Forum Recent Posts