URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
25 views

Redirect all the traffic from multiple domains to single domain using htaccess

I have hosted multiple websites on my server all sharing the same code base having one htaccess. I need something like this. if (domainname != example.com) redirect to example.com if there ...
1
vote
1answer
12 views

how to use mod_rewrite in apache for a rest application

I'm not very experienced with apache but I have managed to run with the following set up for months on my test box: me@mydev:/etc/apache2/sites-enabled$ vim 000-default.conf <VirtualHost *:80> ...
0
votes
1answer
28 views

What does this RewriteRule do?

I'm trying to migrate rewrite rules from apache to nginx. Can anybody explain what RewriteRule ^api/.$ - [L] does?
-1
votes
1answer
22 views

Point subdomain to wordpress path

I have a single Wordpress instance hosted at 1.2.3.4 with the following DNS settings: A foo.com 1.2.3.4 A category.foo.com 1.2.3.4 The site is accessible from both hostnames, however, I would like ...
0
votes
1answer
19 views

.htaccess configuration to mask site?

I own a domain on godaddy (rainychat.com) and i have an app on Openshift (rainychat-jgal.rhcloud.com) Currently i have a forwarding rule on godaddy so when a user goes to rainychat.com it is ...
0
votes
1answer
21 views

mod_rewrite redirect and hide extension

I want to hide the .php extension from all files and my regex is not working properly, it is redirecting the following /path/to/script.php?param1=test.php -> /path/to/script?param1=test It is ...
1
vote
1answer
19 views

Having issues with my websites htaccess

I recently uploaded a PHP theme on my server. It's working fine on any other sections except my home page. For example, when accessing www.mywebsite.com/anything the theme is working but when on ...
0
votes
3answers
30 views

Redirect to client subfolder on apache

I'm hosting a few small client pages within my web application. Basically, they all are instances of the web application I wrote, for different clients. I'm deploying with capistrano, and so each time ...
0
votes
0answers
7 views

apache proxypass depending on querystring

I have two apps listening on ports :8085 and :8888 respectively. I am trying to serve either of the two apps depending on the presence of a querystring. My httpd-vhost looks like RewriteEngine On ...
2
votes
3answers
34 views

How do I set up a toggle for an Apache RewriteRule?

I have the following Apache config, which displays a 503 Service Unavailable error to all visitors except for my IP address: ErrorDocument 503 /503.html RewriteEngine On RewriteCond %{REMOTE_ADDR} ...
0
votes
0answers
25 views

Apache Rewrite and ProxyPass

I got a little problem with my apache configuration at the moment Got a Vhost like this: <VirtualHost *:80> ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9001/www/$1 ...
0
votes
0answers
53 views

rewrite works in htaccess but not in apache2.conf

I am trying to move rewrite rules from .htaccess to apache2.conf (at Kubuntu to use The Bug Genie software). Rewrite rules in .htaccess works fine, but after moving (and adjusting) it to apache2.conf ...
0
votes
0answers
31 views

Issue with mod_rewrite L flag

I'm having problems with the L flag - it's not working as I think it should. Please take a look at the following code: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ...
0
votes
2answers
62 views

Rewrite URLs in apache with &amp; in the query

I am trying to construct a rewrite condition and rule to rewrite URLs with &amp; in the query string, rather than just &. This has occurred because of some invalid encoding when the URL is ...
2
votes
1answer
88 views

mod_rewrite with multiple QUERY STRINGS

This is an extension to my question http://serverfault.com/a/761474/77231 I am trying to add an additional QUERY STRING parameter to the URL and change spaces to underscores but am having no success. ...
0
votes
0answers
10 views

Howto rewrite http://domain.com/~user to http://domain.com [duplicate]

I'm trying to create a mod_rewrite rule that says any links clicked on my website that refer to http://olddomain.com/~user instead go to http://domain.com - Is this possible?
0
votes
0answers
11 views

Apache RewriteRule with Proxy and Changing Content-Type

We are currently using mod_proxy to proxy to proxy to the correct destination with the following line: ProxyPass /my-path balancer://server/path/to/real/thing However, a third party is sending us ...
2
votes
2answers
21 views

Forward to https keeping the URL intact/complete

I want to forward all traffic to https. There can be subdomains and subpaths in the URL that should stay intact. Example: http://subdomain.myDomain.me -> https://subdomain.myDomain.me ...
-1
votes
1answer
33 views

Forcing HTTP to HTTPS causing 404 error

I have a website based on WordPress, and one section of it is built by external programmers (the backend). I was able to force all connections to go on HTTPS instead of HTTP using a plugin for the ...
1
vote
1answer
55 views

Apache redirect some url to homepage

I am trying to implement a simple rewrite, but looks like i am doing something wrong. What I am trying to do is that I have a url blog.example.com/articles/ which gives me 404 , and other urls are ...
0
votes
1answer
48 views

mod_rewrite to replace all dots with underscores after path

I've been through all tagged questions here and on SO, but my problem is different because of either/both needing to replace "." with "_" comes after a particular path and I'm running through a ...
0
votes
0answers
53 views

Apache htaccess config not working after upgrading from 2.2 to 2.4

Our document root is /var/www/foo.com/ and in /var/www/foo.com/lodging/ I have this .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /lodging/ # redirect base lookups to wp cms ...
1
vote
1answer
34 views

Can I use Apache variables with mod_alias's `Redirect`, instead of using mod_rewrite?

The Apache HTTP Server's mod_alias provides the Redirect directive which is great for simple redirects, like the following: # Redirect login to https Redirect permanent /login ...
0
votes
0answers
6 views

htaccess rewrite incoming links to new one [duplicate]

I'm having a problem with site migration and old links. Now, its not just a server migration, it was also a CMS migration. Site went from umbraco (asp.net) to wordpress. Problem is that google indexed ...
2
votes
0answers
24 views

Redirect user to an arbitrary application protocol (used by Android app)

I have an Android application that declares an intent using a in-house protocol. You can launch it by opening a webpage that contains a link to : myapplication://foo-bar I want to an URL on my ...
0
votes
0answers
22 views

expire 401 or redirect it apache proxy

I'm not sure if this is something handled in OIDC or apache in general but what I'm seeing is this and was hoping for some advice: A customer is logged into multiple Google accounts and at the ...
0
votes
0answers
15 views

Apache proxy request from mod_rewrite gets messed up by NGINX reverse proxy

I have several websites and I am transitioning from using perlbal as my reverse proxy, to using nginx as my reverse proxy. Things are mostly moving along OK, and I even got SSL to work very nicely. ...
0
votes
0answers
24 views

Rewrite Query String to Display as Subdomain in Browser?

I have search every possible resource however, I have not been able to find the help i need so i thought i would ask here. I am not highly educated in .htaccess rewrites so please bare with me if i ...
0
votes
1answer
15 views

Apache2 and proxy_balancer BalanceMember

I've got this Apache2 site configuration, allowing me to "run Apache as a proxy" of the localhost:8080 service. <VirtualHost *:80> ServerName foo.mydomain.com RedirectPermanent / ...
0
votes
0answers
39 views

Htaccess redirect to https and www using a single RewriteRule

I have the following in my .htaccess file: RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\. RewriteRule .* ...
1
vote
0answers
28 views

apache SetEnvIf Request_URI getting 404 Not Found error

Currently running site on apache server on ubuntu and now whole site is protected with .htaccess authentication. Want to do: I need to allow two URL without authentication. sites1.conf ...
1
vote
0answers
17 views

Have both redirects for HTTP to HTTPS and canonical/aliases working together

I'm having issues with having both rules work at the same time, my conf file follow <VirtualHost *:80> ServerName mytest.domain.com ServerAlias www.mytest.domain.com mytest2.domain.com ...
-1
votes
1answer
24 views

Apache redirect to SERVER_NAME

Sorry for noob question. Apache 2.4 on Ubuntu 14. I'm seeing a lot of redirect answers that hard-code urls into them. I also saw an answer that includes Apache macro and variables. I want a simple, ...
1
vote
1answer
30 views

mod_rewrite issue Apache behind Nginx

I have nginx proxying to apache as a backend in order for nginx to handle static assets. Unfortunately when I attempt to visit a "pretty url" it just displays the index page. nginx config server { ...
0
votes
1answer
12 views

Implement apache equivalent mod_rewrite functionality in lighttpd

Here's the mod_rewrite .htaccess file which is meant to work on Apache Servers for my web-app RewriteEngine On RewriteBase /cs200/tokens/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
0
votes
0answers
10 views

Most compact and speedy mod_write map?

I am storing a list of paths in a mod_rewrite map. With 4MB and 120000 entries, it seems prudent to use a RewriteMap with a dbm format, instead of a plain text file. Apache seems to support multiple ...
-1
votes
1answer
30 views

Proxy pass to multiple sub domain in apache 2.4

In my webserver (Ubuntu 14.04), I have installed Apache 2.4, tomcat 7 and shiny web framework. I want to use Apache 2 to server all my webpages. So I use JKMount to set sub directory tomcat_demo for ...
1
vote
1answer
35 views

Force HTTP on all pages except specific URLs

I have a situation where I need to force every single page in my site to redirect to HTTP except for two specific URLs which need to force redirect to HTTPS. The two pages that need to redirect to ...
0
votes
0answers
21 views

RewriteCond fails on existing file

So, my .htaccess file starts with: Options -MultiViews RewriteEngine on RewriteBase / And I tried: RewriteCond %{REQUEST_FILENAME} -f or RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f or ...
0
votes
1answer
43 views

How to read specific character out of request header in apache http.config

We are trying to read specific character out of http request header to determine the type of URL it needs to be forwarded it. E.g., Http header - HTTP_ACCEPT=version.ver1+xml In Httpd.config, we ...
1
vote
0answers
31 views

Apache rewrite rule 403 error

I'm running Apache 2.2.15 with rewrite_module installed. I have rule in my vhost.conf as follows; RewriteRule \n ^/advanced/selector/profiles/([A-Za-z0-9]+)/?$ \n ...
1
vote
0answers
26 views

Hide index.php in subdirectory after rewrite (lighttpd)

How it is set up now I have a website which is setup for clean urls with apache mod_rewrite like this: RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond ...
0
votes
1answer
10 views

Apache: Extracts parts of variables from rewrite rules in headers

I have a rewrite map associating pictures hash to the real path (to be kept secret) of the picture. With a single rewrite rule I can give back the picture with the hash as the url, that's fine. ...
0
votes
1answer
41 views

Without using mod_rewrite, what is the best way to redirect all subdomains to https? [duplicate]

I am currently using mod_rewrite to redirect all subdomains to https, but multiple sources have suggested that Using mod_rewrite to do this isn't the recommended behavior. See RedirectSSL The ...
0
votes
0answers
86 views

Fix ERR_TOO_MANY_REDIRECTS after adding trailing slash in URL

I have a Magento website hosted in a managed server where we need to use two .htaccess files, the first one is needed to redirect all request to a subfolder /current/src/ and is placed directly in ...
0
votes
0answers
18 views

Apache rewrite rules in both config and .htaccess

I have a CakePHP application hosted in a virtual host (Apache 2.4) which works OK. Now in the internal network where the virtual host name cannot be routed so I have to use the web server IP. And ...
0
votes
2answers
51 views

apache 2.2 mod_rewrite redirect some urls to https and force http for others

I have my page at a shared host. In general the site is reachable using http and https. The page serves ads and most of the ads are not available using https therefore I only want the admin parts to ...
1
vote
1answer
21 views

need the name of http_host for a htaccess rewrite condition

I want to write a rule where I don't know the exact http_host. For example I have (www.)?example.com. Now I need example to build the following: (www.)?example.com/example/... in a RewriteRule. So ...
0
votes
0answers
57 views

Backreferencing a cookie value in rewriterule

I'm trying to backreference a cookie's value in a RewriteRule : # Trace rewrite rules log LogLevel alert rewrite:trace4 # Rewriting the URL, in the cookie's condition i've tried en alone, and ...
1
vote
1answer
18 views

Issues with rewriting all http and https domain traffic to https based url

I am trying to get all variation http://www.example.com http://example.com https://www.example.com https://example.com www.example.com example.com to all redirect to https://www.example.com I ...