htaccess RewriteRule page with query string

You need to match against the %{QUERY_STRING} variable. The query string isn’t part of the match in a RewriteRule: RewriteCond %{QUERY_STRING} ^who=a$ RewriteRule ^people.php$ /people/?t=leadership [R=301,L] RewriteCond %{QUERY_STRING} ^who=f$ RewriteRule ^people.php$ /people/?t=faculty [R=301,L] RewriteCond %{QUERY_STRING} ^who=p$ RewriteRule ^people.php$ /people/?t=students [R=301,L] RewriteCond %{QUERY_STRING} ^who=r$ RewriteRule ^people.php$ /people/ [R=301,L] RewriteCond %{QUERY_STRING} ^$ RewriteRule ^people.php$ /people/ [R=301,L]

Enable CORS with wamp on windows 8

I had the same problem and i solved it with these 3 steps: 1) in Apache config file (for me the path was C:\wamp\bin\apache\apache2.4.18\conf\httpd.conf) add the line: Header set Access-Control-Allow-Origin “*” in the content of the <Directory> tag: DocumentRoot “c:/wamp/www” <Directory “c:/wamp/www/”> Options +Indexes +FollowSymLinks Header set Access-Control-Allow-Origin “*” AllowOverride all Require local </Directory> 2) … Read more

RewriteCond to match query string parameters in any order

You can achieve this with multiple steps, by detecting one parameter and then forwarding to the next step and then redirecting to the final destination RewriteEngine On RewriteCond %{QUERY_STRING} ^category=([^&]+) [NC,OR] RewriteCond %{QUERY_STRING} &category=([^&]+) [NC] RewriteRule ^index\.php$ $0/%1 RewriteCond %{QUERY_STRING} ^subcategory=([^&]+) [NC,OR] RewriteCond %{QUERY_STRING} &subcategory=([^&]+) [NC] RewriteRule ^index\.php/[^/]+$ $0/%1 RewriteCond %{QUERY_STRING} ^product=([^&]+) [NC,OR] RewriteCond %{QUERY_STRING} … Read more

RewriteRule checking file in rewriten file path exists

RewriteRule ^pages/([^/\.]+) cache/pages/$1.html [NC,QSA] # At this point, we would have already re-written pages/4 to cache/pages/4.html RewriteCond %{REQUEST_FILENAME} !-f # If the above RewriteCond succeeded, we don’t have a cache, so rewrite to # the pages.php URI, otherwise we fall off the end and go with the # cache/pages/4.html RewriteRule ^cache/pages/([^/\.]+).html pages.php?p=$1 [NC,QSA,L] Turning off … Read more

Apache + Tomcat: Using mod_proxy instead of AJP

The settings you are looking for are: <VirtualHost *:80> ServerName public.server.name ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ </VirtualHost> Note that we’re using localhost as the proxy target. We can do this since we enable ProxyPreserveHost. The documentation states that It is mostly useful … Read more