URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

1
vote
0answers
24 views

mod_rewrite and double slash issue

I am getting mod_rewrite and double slash issue can you please help me out. # ProxyPass /balancer-manager ! RewriteRule /phoenix/^(.*) http://phoenixstagingappa.scan-shipping.com:...
0
votes
1answer
35 views

Correct way to block a site if a cookie isn't present apache 2.4

I'm using apache 2.4.12 (Ubunutu 15.10) as an oauth2 proxy behind a node app. The app sends lots of unauthenticated requests before login b/c it doesn't know it's not authenticated (it doesn't know/...
0
votes
0answers
185 views

Can Tomcat 8 Rewrite Valve be used to forward access to specific ports?

I have a server (server.mycompany.com) which have (among others) several java applications running in tomcat containers, each on it's own port. On port 80 is an Atlassian Confluence wiki, installed in ...
1
vote
2answers
57 views

Serving multiple directories outside of web root from the same URL with Apache2

Is it possible to set up Apache to serve multiple directories from the same URL? For example, given that I have images in two locations: /mnt/imagestore1, /mnt/imagestore2. I would like mysite.com/...
1
vote
0answers
148 views

NGINX - rewrite_log does not work log rewrites anywhere

I was attempting to learn rewrites, by making something like this: ^/blog/install/(.*)$ --> /blog/install/index.php?_p=$1 However these rewrites simply kept failing, and it was difficult to ...
0
votes
0answers
34 views

Apache - how to match against a variable within regex?

Trying to match a variable against another in a directive does not work: RewriteCond %{REQUEST_URI} /absolute/path/%{REMOTE_USER}/ Trying the If directive in Apache 2.4 doesn't work either: <If ...
0
votes
0answers
32 views

RewriteRule — how to serve file from subdirectory, but show requested URL using only .htaccess

I want to be able to switch between dev/live subdirectories without altering the URL that displays in the browser and without having to modify httpd.conf. I want https://domain.com to actually serve ...
0
votes
1answer
39 views

How to exclude a domain from redirection in Apache2

I have a blanket redirect setup on the server like this: <IfModule mod_rewrite.c> RewriteEngine On #redirect all port 80 traffic to 443 RewriteCond %{HTTPS} ...
0
votes
1answer
45 views

Apache mod rewrite to block xhr requests

I've observed that xhr requests getting redirected to oauth servers is a bad thing (b/c it's a robot and it can't respond to the request). It also seems that responses responses meant for people and ...
2
votes
1answer
28 views

Something like foreach in htaccesss?

I am in this situation: url: domain/var1/var2/var3/.../varn And I want to change that url in: url: domain?v1=var1&v2=var2&v3=var3/.../&vn=varn I found this way: RewriteRule domain/([...
0
votes
1answer
39 views

Apache Domain Redirect & Rewrite Query String

My Apache server will be receiving incoming requests from users in this format: http://192.168.1.182/SEARCH=searchstring&URL=http://test.com/blahblahblah I want to redirect users to another ...
1
vote
1answer
42 views

Switching from apache to nginx - mod_rewrite issue

I just switched my server over from apache2 to nginx and now I am having some issues with my .htaccess rewrites. <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -...
1
vote
1answer
168 views

Wildcard subdomain redirect to folder without changing the url

So I got my htaccess file set up, it look like this: Options +FollowSymLinks RewriteEngine on RewriteBase / # MAGIC RewriteCond $1 !/$ RewriteCond $1 !\. RewriteRule ^(.+)$ /$1/ [R=301,L] # //...
0
votes
1answer
47 views

Set header based on %{REQUEST_URI}

I am trying to set a header based on the URI of a particular page. I access a page using chrome. Inspect element and see that my URI header is giving the value /bst/index.html Now in my Apache config ...
0
votes
1answer
108 views

mod_rewrite not working for apache alias

I have created a documentation wiki that i want to attach to my main site using an Alias for the virtual host. This allows me to access the wiki by going to website.com/documentation. I have ...
1
vote
0answers
26 views

sending back rewrote url without forcing a new request

The user of my application issue commands (create new post, delete comment etc.) via links with nonce parameter. As this is transported via GET the URL bar contains this technical detail. I want to ...
2
votes
1answer
174 views

Laravel and Wordpress on same server/domain

I am trying to host a WordPress site inside a Laravel(5.1) project. I have the following structure (stripped down some) ├── app ├── config ├── public │   ├── index.php │   ├── wordpress -> ../...
1
vote
1answer
466 views

apache2.4 mod_rewrite exclude specific alias directroy/uri

I have the following setup on one of my vhosts: ...<VirtualHost *:80> ServerName cloud.domain.de ServerAdmin webmaster@domain.de ServerSignature Off Alias "/.well-known/acme-...
0
votes
1answer
18 views

move mod_rewrite content from .htaccess to apache2.conf

After moving this mod_rewrite code from .htaccess in the directory to apache2.conf its no longer working RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d ...
0
votes
0answers
26 views

problematic htaccess remapping of old domain urls to custom pages on new domain

I am remapping a bunch of urls from old domains to custom pages on the new domain, and a handful of rewrites for old urls don't seem to be applying. These are the rules i have now for the domain ...
0
votes
1answer
26 views

Redirect with an exception

I think this is easy but I am afraid I cannot solve this all by myself. I have moved a website to another domain, and I've set up some permanent redirections. However, I'd like to preserve one URL ...
0
votes
1answer
14 views

ModRewrite and folder with timestamp

I'm trying to forbid users access to a certain folder that has the current date in the folder name. This does not work: RewriteCond %{REQUEST_URI} ^/folder%{TIME_YEAR}%{TIME_MON}%{TIME_DAY} ...
0
votes
1answer
19 views

IE not interpreting mod_rewrite rule

I have a really simple mod_rewrite rule: <Directory "/local/foobar.com/"> RewriteEngine On RewriteBase / RewriteRule ^test$ hello/ [R] </Directory> In Chrome, when I go to www....
1
vote
1answer
52 views

Apache rewrite rule to iis

I am trying to move site on apache to iis 8.5 All is ok, but 1 rule failes my site to run properly RewriteCond %{REQUEST_URI} !\.(js|css|jpg|jpeg|gif|png)$ [or] RewriteCond %{REQUEST_URI} apple-...
0
votes
1answer
17 views

How do I prevent RewriteRules conflicting

I have three RewriteRules I am trying to implement but I cannot get all 3 to work together: RewriteRule ^products$ http://%{SERVER_NAME}/en_ca/products [L,R=301] RewriteRule ^products/(.*)$ http://%{...
2
votes
1answer
49 views

Thousands of requests with non-existent domains as HTTP_REFERER [duplicate]

For the last few days one of my websites has been receiving hundreds of requests per minute with non-existent random domains as HTTP_REFERER and from different IPs (therefore using deny from IP is not ...
3
votes
1answer
778 views

Htacess rewrite for AngularJs App

I need help regarding AngularJs application. I need htacess file for HTML5Mode in AngularJS and Hashbang fallback. Can someone help me? Cuz i get %2F when i use backslash. I've been folowing along ...
0
votes
1answer
249 views

Use of ProxyPassReverse to change Location response header

I am implementing a reverse http proxy: proxy.example.com This will forward requests to servers based on URI: proxy.example.com/server1 -> server1.example.com When a user requests proxy.example....
0
votes
1answer
54 views

Apache Mod Rewrite - exclude folder and subfolders, except for one subfolder

I have a Mod_Rewrite setup as follows: RewriteCond %{REQUEST_FILENAME} !^/www/live/site.name/app/public/(/forms/|/crm/) RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f ...
2
votes
1answer
126 views

Apache RewriteRule 502 Error on dev server, works on live

I'm on Apache 2.2.15. My vhost.conf contains a RewriteRule to handle article URLs; # handling for neat article titles RewriteRule ^/news/[0-9]{4}/[A-za-z]{3}/([0-9a-zA-Z-]*)/([0-9]{4})([0-9]{6})/?$ "/...
0
votes
1answer
68 views

.htaccess: RewriteRule: bad flag delimiters

I added RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} /article/ RewriteRule ! ^article/\d+ redirect.php [L] to .htaccess and got a .htaccess: RewriteRule: bad flag delimiters ...
0
votes
2answers
17 views

Apache Mod Rewrite direct delevering content

i would like to know if it is possible to send a 200 status with a page content without passing by a status 30x ? exemple or rewrite condition: RewriteCond %{HTTP_USER_AGENT} ^-?$ RewriteCond %{...
0
votes
0answers
61 views

mod_rewrite hide URL params

I have the following URL: www.mydomain.com/musician.php?musician=musicianname&id=idnumber I am using mod_rewrite to achieve this: www.mydomain.com/musician/musicianname/idnumber This is the rule ...
0
votes
0answers
10 views

Weird request, trying to correct with rewrite rule

I've got some really weird requests coming into the site. We've tried replicating in all browsers, mobile, tablets, etc etc... but still can't figure it out! As an intermediary, we are trying to force ...
0
votes
1answer
74 views

Sanity Checking mod_rewrite for Apache 2.2 on Ubuntu 12.04

Summary: I'm testing a simple catch-all rewrite rule. It doesn't seem to be taking effect, it's not being logged and I'm not getting any errors. I'm a junior server administrator trying to gain a ...
-1
votes
1answer
36 views

RewriteRule running after Require test failed which rewrites 403.shtml to website content instead of error message

When a request gets denied due to require all denied, it first gets routed to the ErrorDocument 403.shtml but then that gets rewritten rather than stopping there and the site content actually gets ...
0
votes
1answer
22 views

RewriteRule [E=let_me_in] and 'Require env let_me_in' don't work together

I have a problem similar to this: http://www.tek-tips.com/viewthread.cfm?qid=1144803 I'm trying to grant access, if specific RewriteRule triggered. Setting a var using [E] flag, but the var seems ...
-3
votes
2answers
33 views

apache conf entry does not work but does in .htaccess [closed]

i am running: Server version: Apache/2.2.15 (Unix) i have a custom security conf file on a shared server. i placed the following entry at the top of the file with no joy, and i also placed it at ...
0
votes
2answers
19 views

forbid cgi invocation by direct url, but allow via a RewriteRule

I want to allow anonymous client execute a script via a special URL, but not directly. Everything else should require auth. <Directory "/srv/http"> Require all granted </Directory> &...
1
vote
1answer
123 views

How to internal redirect from one virtualhost to another Apache [duplicate]

I'm upgrading my application to new PHP version. For that I created two virtualhosts one server PHP 5.3 application and another with PHP 5.6. My virtualhosts are like, <VirtualHost *:80> ...
0
votes
0answers
58 views

How to get a useful error about failed .htaccess redirects?

I am trying to set up a test server on localhost for a LAMP app that's already live, in order to allow my team to write and test some new features. On a vanilla installation of Fedora 22, I have ...
0
votes
1answer
24 views

How is leading slashes handled in server and in client?

I am trying to create a RewriteRule, but it's unreliable and I can't figure out what is happening. Here's my rule: RewriteRule ^docs/(......)/$ index.php?docid=$1 [L] the problem is leading slashes,...
0
votes
0answers
12 views

Apache RevProxy and Webapp with subfolders

I would like to extend my current RevProxy. By a subfolder (www.example.com/subfolder) I would like to make an small webapp available. Here is my configuration from RevProxy: ProxyPreserveHost ...
1
vote
1answer
30 views

Redirect to HTTPS and subdirectory is visible [duplicate]

I am forcing HTTPS and redirecting to subdirectory with: RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301] RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR] ...
1
vote
2answers
44 views

mod_rewrite: web page has a redirect loop [duplicate]

I'm trying to have a parameter that comes just after he hostname, as in: www.domain.com/parameter For this reason, I've set the following rewriteRule, for two parameter values that I'd like to ...
0
votes
1answer
17 views

.htaccess not behaving as desired

Eventhough I'm new at htaccess, I've been learning a lot in the past few days, but I'm stuck on a certain part that resulted in the website not behaving as desired. Here is the part of the code where ...
2
votes
2answers
229 views

Special characters in URL causes custom redirect to fail

I have a domain on which I am trying to set custom redirects for the error pages. My .htaccess file looks like so: RewriteEngine On AddDefaultCharset UTF-8 DefaultLanguage en-US # disable TRACK and ...
0
votes
1answer
51 views

System error in Apache with combination of https redirection plus password requirement plus error document

In an Apache 2 vhost I have the following configuration (in my case, in .htaccess of the document root (which is for simplicity the same for http:80 and https:443) RewriteEngine On RewriteCond %{...
-2
votes
2answers
75 views

apache virtual host config

hi im trying to ensure that my website is only accessed via https, and only through the www sub domain, im currently using the following apache virtual host config: <VirtualHost *:80> ...
0
votes
0answers
80 views

Apache reverse proxy rewrite failing to mask internal URL

I am having an issue setting up a Reverse proxy scenario to an internal URL authentication service. Using Apache I have setup the below - ProxyPass "/mqa/login/" "https://internal.com:8880/...