URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

1
vote
0answers
10 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
13 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
0answers
15 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
21 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 ...
0
votes
0answers
13 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
0answers
6 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
34 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
51 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
11 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
41 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
13 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
33 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
17 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
31 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 ...
-1
votes
0answers
19 views

nginx: rewrite relative paths and exclude some paths

Here again the bloody regex: i want to rewrite from : /city/listings/restaurants to /city/restaurants *i.e: i want to remove listings from url* **** pls note "city" and "restaurants" always ...
0
votes
0answers
31 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
42 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
66 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
21 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
19 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 ...
1
vote
0answers
18 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
78 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
19 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
32 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
33 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 ...
0
votes
2answers
24 views

Apache URL masking

I need to access http://www.domain.com/uri-path-to-resource.rsc in the browser, but to display the content from http://shop.domain.com/uri-path-to-resource.rsc. Unfortunately ProxyPass could not be ...
1
vote
0answers
18 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/^(.*) ...
0
votes
1answer
19 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 ...
0
votes
0answers
38 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
26 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 ...
0
votes
0answers
29 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
15 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
16 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
29 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
34 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
20 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 ...
0
votes
1answer
17 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
29 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
64 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
18 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
42 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
17 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
80 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 -> ...
0
votes
1answer
86 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 ...
0
votes
1answer
16 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
20 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
12 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
10 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 ...