URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
8 views

htaccess on subdomain & query string

I have the following htaccess RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} ^(.*).domain\.com RewriteRule ^(.*)$ index-merchant.php?id=%1 [NC,QSA] It can capture ...
0
votes
0answers
24 views

Tomcat/apache2 application - virtual host issue. Welcome.action URL not found. Possible mod_rewrite issue

Im having some issues setting up a tomcat application to work with apache2. My KonaKart tomcat application is running on port 8783. And I'm trying to access it publicly on port 443. I created the ...
0
votes
2answers
36 views

Apache rewrite all URLs to lowercase if contains at least one uppercase

I have been trying to get Apache to rewrite all URL's that contain an uppercase character anywhere in it to be lowercase. All the solutions I have found do not work in my case for some reason. I am ...
2
votes
2answers
35 views

How to keep one page of a site secure using mod_rewrite

I'd like redirect access to a url from http to https for only a couple of pages on my website. I know how to do it for a whole site using the rewrite in apache virtual hosts: RewriteEngine On ...
0
votes
0answers
6 views

How to redirect all specific character strings? [duplicate]

I want to redirect all character strings to the index page using the RewriteCond Directive. A few examples to illustrate my intention www.example.com/character-string/ should redirect to ...
0
votes
1answer
53 views

RewriteRule changes URL only when it doesn't end with slash?

This simple rule in .htaccess handles languages at my website: RewriteRule "^(de|it|es|fr|en-us)(?:|/(.*))$" "$2?lang=$1" [NC,QSA] It works fine unless I miss slash at the end of URL. Than it ...
0
votes
2answers
42 views

How to disable the automatic redirection in WordPress-htaccess-file

WordPress has a function in its htaccess-file which performs an automatic redirection if the filenames match with an existing source. For example if you type in ...
0
votes
1answer
23 views

apache2 rewrite rule: delete any path from URL

I'm going crazy with a Rewrite Rule on Apache. Basically what I want to achieve is to rewrite any url like: http[s]://www.example.com/something to https://www.example.com I have a VHost on ...
1
vote
0answers
7 views

Limit access for subdir url

I would like to limit access for this url, http://example.com/dir/login however it doesn't work. The .htaccess lives inside the subdir. The conditions and rule itself works without the REMOTE_ADDR ...
0
votes
0answers
27 views

Rewrite URI so all occurrences that match strings is rewrited

I'm new to regex and I'm trying to write a rewrite query, but without results. So I hope some one can help me to solve this. So my rewrite rule looks following: RewriteCond %{QUERY_STRING} ...
0
votes
0answers
20 views

Running Rails apps on subdomain with Apache and mod_rewrite WITHOUT VirtualHost

I am host a number of domains on Apache (Ubuntu). I am not using VirtualHost for all the domains, I am using mod_rewrite (and a custom RewriteMap to boot) to map domains and subdomains to a variety ...
0
votes
1answer
73 views

Apache rewrite rule to redirect a URL with parameters to a URL without parameters [duplicate]

I want to go from: www.website.com/directory/results?category=10&dir=asc to www.website.com/staticfile.html I tried the following and it doesn't seem to catch: RewriteRule ...
0
votes
1answer
20 views

Rewrite for Proxying

I have 2 servers. example.com and proxy.example.com I would like proxying /server/(.)/banner/(.) to http://proxy.example.com/banners/banner_$2_$1.png I have prepared in example.com apache2 vhost ...
0
votes
1answer
62 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
14 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
26 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
25 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
20 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
32 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
10 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
35 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
30 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
59 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
74 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
93 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
13 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
26 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
42 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
56 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
52 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
70 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
46 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
26 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
26 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
40 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
20 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
27 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
32 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
14 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
40 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 ...