mod rewrite - Apache: Except a path from RewriteRule -
mod rewrite - Apache: Except a path from RewriteRule -
i'm trying except beingness redirected /portal/ if access /sitemapht/ seems process ^(/$|!sitemapht) wrong, since still redirecting me /portal/
<virtualhost *:80> documentroot "/opt/tomcat-5.5.30/webapps/portal" servername hoteles serveralias hoteles jkunmount /images/*.gif w1 jkunmount /images/*.png w1 jkunmount /images/*.jpg w1 jkunmount /js/*.js w1 jkunmount /styles/*.css w1 jkmount /portal w1 jkmount /portal/* w1 rewriteengine on rewritecond %{request_method} ^(trace|track) rewriterule .* - [f] options +followsymlinks rewriterule ^(/$|!sitemapht) /portal/ [r] rewriterule ^/(?!portal)(.*) /portal/ficha.action/$1 [pt] </virtualhost> could suggest me proper correction?
thank you!
i hope understood correctly:
rewritecond $1 !^/(sitemapht/|portal/) rewriterule ^(.*) /portal/ [r,l] this redirect (302 code) incoming requests /portal/ except /sitemapht/ or when requesting /portal/ directly.
update:
rewritecond $1 !^/(sitemapht/|portal/) rewriterule ^(.*) /portal/ [r,l] rewritecond $1 !^(sitemapht/|portal/) rewriterule ^/(.*) /portal/ficha.action/$1 [pt] use above rules instead of lastly 2 lines:
rewriterule ^(/$|!sitemapht) /portal/ [r] rewriterule ^/(?!portal)(.*) /portal/ficha.action/$1 [pt] mod-rewrite apache2 apache
Comments
Post a Comment