URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
33 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
95 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
98 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
16 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
29 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 http://...
-1
votes
1answer
51 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
60 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
60 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
95 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 (...
2
votes
1answer
73 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 https://www.example.org/...
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
29 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
47 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
19 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
35 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
17 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 / https:/...
0
votes
0answers
40 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 .* https://www.%{HTTP_HOST}...
1
vote
0answers
55 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
27 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
32 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
39 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
17 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
11 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
49 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
54 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
25 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
36 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 "/advanced/selector/profiles/...
1
vote
0answers
33 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
11 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
45 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
108 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
21 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
66 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
25 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
75 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 en|fl|...
1
vote
1answer
19 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 ...
0
votes
1answer
100 views

url rewrite, nginx throw 404 errors, nothing in error logs

below rewrite works fine: rewrite ^/city/restaurants$ /city/listings/restaurants permanent; but this doesnt work rewrite ^/city/restaurants$ /city/listings/restaurants last; rewrite ^/city/...
0
votes
0answers
40 views

How to block referral source on apache with special characters?

I've been getting referral spam on my site. I've tried several options to block it, but it still hits it. I think it has to do with being special characters on the referral? This is the referral ...
0
votes
1answer
241 views

Apache redirect - let's encrypt SSL certificate redirecting to naked domain rather than www

I recently set up a new website running off Wordpress which is working nicely. Since I wanted to have an SSL certificate for the website I thought I'd use Let's Encrypt since I've been hearing a lot ...
0
votes
3answers
195 views

How to make Apache’s mod_rewrite redirect over HTTPS by default?

Let’s say I have a website that is available over HTTPS, e.g. https://example.com/foo. Consider the following .htaccess: RewriteBase / RewriteEngine On RewriteRule ^foo$ bar [R=301,L] Now, when I ...
0
votes
1answer
46 views

Redirecting all requests on one domain to https non-www

I have an ISPConfig 3 site running on one domain. I have multiple vhost files for the different applications I run through Apache. I want to enable https://example.com/%QUERY_STRING% on every request ...
0
votes
0answers
23 views

Apache redirect to https from multiple domains

I have a virtualhost with multiple domains that point to it (servername and alias). I find a solution to redirect every domain to https:/ /example1.com and works fine. But now, i want to redirect also ...
2
votes
1answer
69 views

Custom headers (mod_headers) not showing in combination with mod_rewrite

I have a vhost with multiple domainnames linked to it. I'm trying to send additional headers when a request is made to one particular domainname. Here's what I'm doing (tried both in the vhost as in ....
0
votes
0answers
5 views

Rewrite subdomain path to absolute path using htaccess [duplicate]

I need some help with htaccess to redirect a subdomain path to a totally different subdomain path. Example: http://support.domain.com/need/help --> http://blog.domain.com/8212/need-help I was ...
3
votes
1answer
144 views

Apache Directives Ordering: Global, Pre-VHost, or in Directory blocks

I'm setting up my first virtual server from scratch (provider name omitted but it's a 'droplet'). I've been using WHM for a while and I feel I'm fairly familiar with it. Specifically, it's a Debian 8 ...
0
votes
0answers
45 views

mod_rewrite index.php behind varnish server

I have on my pfSense router a Varnish server currently with 4 backends. 3 of the backends go to the same server on my network and the 4th goes to my development server I'm using to get some webapps ...
0
votes
1answer
164 views

How to Handle Routes of Two Laravel Projects on One Domain or Server?

I'm working on a project divided into two separate parts. Part one, the bigger part, is in Laravel 4.2. Part two, the shorter part, is in Laravel 5. Both are on the same server. My goal is to access ...
0
votes
1answer
45 views

htaccess - insert php script name into all URLs

I have an application which requires an htaccess file in the directory /tileserver/ that contains the following: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 ...