plainblack.com
Username Password
search
Bookmark and Share
Subscribe

URL Masking

This is a bit more about Apache than WebGUI, but it is a useful topic any user of Apache. Masking URL's can save some work and are especially useful if you just need to show a single page under a separate domain. Say, for instance, you want to have the content from www.anotherdomain.com display the content located at www.domain.com/dir/.

Masking URL's require mod_rewrite and mod_proxy [P]. Mod_rewrite is already enabled in the modproxy server for your site. It's easiest to copy the current virtual host in your modproxy config file and create an additional virtual host the same file. Edit /data/wre/etc/www.domain.com.modproxy and add the following rules, making sure you have RewriteEngine on in your copied virtual host.  

        # mask real url
        RewriteCond %{REQUEST_URI} ^/css
        RewriteRule ^(.*)$ http://www.domain.com$1 [P,L]

        RewriteCond %{REQUEST_URI} ^/media
        RewriteRule ^(.*)$ http://www.domain.com$1 [P,L]

        RewriteCond %{REQUEST_URI} ^/uploads
        RewriteRule ^(.*)$ http://www.domain.com$1 [P,L]

        RewriteRule ^(.*)$ http://www.domain.com/dir/ [P,L]

Then restart the proxy server:

/data/wre/sbin/rc.apache restartmodproxy 

Keywords: message

Search | Most Popular | Recent Changes | Wiki Home
© 2023 Plain Black Corporation | All Rights Reserved