Tag Info

Hot answers tagged

5

Empty Virtual Host With virtual hosting, all traffic is routed to an IP address and then Apache matches the hostname. When virtual hosting using NameVirtualHost is enabled, the site that responds to the IP address is the first one listed in the Apache configuration file. So you can use a null virtualhost: <VirtualHost 192.168.1.1:80> ...


3

Something similar to the rewrite rules from Jon Lin's StackOverflow answer to Remove Characters from URL with htaccess should solve your problem. I would use this which should rewrite the URL to not have the characters, and then redirect: RewriteRule ^(.*)\'(.*)$ /$1$2 [L] RewriteRule ^(.*)\’(.*)$ /$1$2 [L] RewriteCond %{ENV:REDIRECT_STATUS} 200 ...


2

Your root .htaccess should look like this: # Mod RewriteRules, some 12 in all RewriteRule ^mod/(.*)$ /moderator/$1 [NC,L] RewriteRule ^signup/(.*)$ /acc/signup/$1 [NC,L] RewriteRule ^signin/(.*)$ /acc/signin/$1 [NC,L] RewriteRule ^signout/(.*)$ /acc/signout/$1 [NC,L] # These are the only two that a front end user will use # category/subCategory ...


2

You can use these three rewrite rules which handle up to 3 levels of directories: RewriteEngine on RewriteRule ^main\/([^\/]+)\/([^\/]+)\/([^\/]+)\/? /parser.php?var1=$1&var2=$2&var3=$3 [L] RewriteRule ^main\/([^\/]+)\/([^\/]+)\/? /parser.php?var1=$1&var2=$2 [L] RewriteRule ^main\/([^\/]+)\/? /parser.php?var1=$1 [L] In those regular ...


2

You could simply redirect the user to the named host: # Uncomment the line below if not previously added in the file # RewriteEngine On # Rule to redirect to the named host # Replace [xx.xx.xx.xx] woth your host's IP address # Replace [yourdomain.com] with your host's proper URL RewriteCond %{HTTP_HOST} ^xx\.xx\.xx\.xx$ RewriteRule (.*) ...


2

Check your Jetty configuration because although your "localhost" ProxyPass might take you to the proper host, the server itself may be configured to use the IP as a hostname (or not have the hostname configured properly at all). The behavior that you are describing about the URL also points in the same direction - your ProxyPass works but then the host is ...


1

First, use <VirtualHost *:80> instead of <VirtualHost 1.1.1.10:80>. That way your virtual host applies no matter what the IP address of your server is. Second, you need to issue a redirect if the host name isn't what you expect. I would recommend having two virtual hosts. The first is the default one for any unexpected domain names or IP ...


1

You're probably best doing this using a setup of 3 VirtualHost declarations. The first, becomes a default catch-all for any name that has not been specified, and you could have an index.php in the /var/www/default/ that either returns a blank page or an HTTP 404 response etc: <VirtualHost *:80> ServerAdmin webmaster@example.com ServerName ...


1

I would be surprised if they had mod_proxy enabled on their shared hosting servers. The amount of abuse that would open them up to would be quite high. If you are on your own VPS instance then you can simply log in as root and issue the "a2enmod proxy_http" on debian/ubuntu and then restart apache. http://www.justhost.com/vps


1

The use of a rewrite condition along with a rule to map transparently to the subdirectory should work. RewriteCond %{HTTP_HOST} ^abc\.mybiz\.domain\.com$ [NC] RewriteCond %{REQUEST_URI} ^(/|.*\.html)$ [NC] RewriteRule ^/(.*)$ /abc/$1 [L] Now when a request for http://abc.mybiz.domain.com/ or http://abc.mybiz.domain.com/index.html is made it will be pulled ...


1

As it stands, you are redirecting to the same host. ie. demo.example.com/file is redirecting to demo.example.com/my-demo/file, not example.com/my-demo/file, which is going to result in a redirect loop. You need to specify an absolute URL in the RewriteRule substitution: RewriteEngine On RewriteCond %{HTTP_HOST} =demo.example.com RewriteRule ^(.*)$ ...


1

Remember that whenever configuring anything for IPv6 in Apache, all IPv6 addreses must be specified in square brackets since otherwise the optional port number couldn't be determined. Ensure in your httpd.conf file that you have a Listen statement present for both your IPv4 and IPv6 addresses, for example: Listen 12.34.56.78:80 Listen ...


1

the example you provide should and does work (tested on 2.2). so I guess the problem will be somewhere else. your env may be getting an another value somewhere else? (note the regexp will not match plain 'sorryspammer.com' - you need something like ^(.*\.)?sorryspammer\.com$ note2: you could use .*sorryspammer, but that is bad practice, since it matches ...



Only top voted, non community-wiki answers of a minimum length are eligible