regex - Rewriting URLs within the webpage with a subdirectory -
i've setup reverse proxy , using mod_rewrite rewrite urls. issue i'm facing urls in webpage go http://domainname.com/pagename
however, want go http://domainname.com/dir/pagename
i've tried bunch of rewrites none seem work.
<virtualhost *:80> # servername directive sets request scheme, hostname , port # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used last resort host regardless. # however, must set further virtual host explicitly. #servername www.example.com serveradmin webmaster@localhost documentroot /var/www/html # available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # possible configure loglevel particular # modules, e.g. #loglevel info ssl:warn errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined # configuration files conf-available/, # enabled or disabled @ global level, possible # include line 1 particular virtual host. example # following line enables cgi configuration host # after has been globally disabled "a2disconf". #include conf-available/serve-cgi-bin.conf </virtualhost> <virtualhost *:*> proxypreservehost on # servers proxy connection, or; # list of application servers: # usage: # proxypass / http://[ip addr.]:[port]/ # proxypassreverse / http://[ip addr.]:[port]/ # example: proxyrequests off proxypass / http://0.0.0.0:8080/ proxypassreverse / http://0.0.0.0:8080/ </virtualhost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet <directory /var/www/> allowoverride order allow,deny allow </directory> <directory /var/www/html> allowoverride order allow,deny allow </directory> <virtualhost *:*> # proxy specific settings proxyrequests off <proxy *> adddefaultcharset off order deny,allow allow </proxy> servername do.domain.com proxypassreverse blog.domain.com do.domain.com/blog/ rewriteengine on rewriterule ^blog.(.*)$ do.cdomain.com/blog/$1 [p] </virtualhost>
Comments
Post a Comment