URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

1
vote
1answer
109 views

Included rewrite rules not matched

With Apache, I'm trying to set up a rewrite rule which will be included in several virtual hosts. Actually, this rule file is included in 2 vhost. The first vhost contains only this rewrite rule (and ...
0
votes
0answers
28 views

Truncate URL's with Apache mod_rewrite

I am trying to strip incoming page requests to 25 characters after the year/month structure of the URL on my Wordpress server. Reason is, there are a number of external 404 links that I would like to ...
0
votes
0answers
18 views

mod_rewrite trailing slash woes [duplicate]

So I have the following .htaccess mod_rewrite which I'm hoping to use to strip trailing slashes: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 ...
0
votes
0answers
21 views

Apache2 keeps rewriting https even though rewrite rules are removed

I am running multiple virtual hosts on a local machine running Ubuntu 14.04 and Apache2. Let's assume that the project I am trying to access has the ServerName directive set to website.local When I ...
0
votes
0answers
8 views

Redirect ip with folders to domains with htaccess [duplicate]

Currently I am using .htaccess file below, but it only redirects correctly with simtanda.com and not with "heartslovefree.com". So help me out please: RewriteEngine on # SIMTANDA RewriteCond ...
0
votes
1answer
81 views

How to share a Single Domain SSL certificate across 2 ip addresses

I have a wordpress website example.com. I have a single domain SSL certificate that can be used across multiple servers. When a user visits example.com, or any subfolder expect forum , they access ...
0
votes
0answers
21 views

Apache2 Rewrite Rule - set a default directory

I'm trying to configure my Apache2. At the moment, when a user navigates to: http(s)://eamorr.com/whatever/ he is served pages from the directory /home/eamorr/eamorr.com/www/whatever (the "www" ...
0
votes
0answers
25 views

apache rewrite rule to strip subdirectory

I have a tomcat application with apache in front of it with proxypass. The application lives at http://host:8080/application and I the proxypass config means I can access it at http://host However, ...
0
votes
0answers
19 views

two parameters in RewriteMap dbd sql query

Is there any way to use %s twice in sql Query of DBD query? RewriteMap vhost "dbd:select path from www where url='%s'" this is working, but this not: RewriteMap vhost "dbd:select path from www ...
0
votes
0answers
21 views

apache2 mod_dbd and postgresql

I'm trying to rewrite url using dbd. Everything looks ok, except few things: It doesn't work It doesn't show any error (LogLevel Trace8) It doesn't show any connection to database (postgresql.log ...
0
votes
0answers
21 views

One session data for two domains

i have two different domains: domain1.com domain2.com I need to display a website from domain2.com on domain1.com. Now i use mod_proxy for this, like this: RewriteEngine on RewriteCond ...
0
votes
2answers
219 views

Redirect page/subfolder to new domain url without changing url in browser

I have been looking for an answer this without any luck (searched everywhere) Basically, I want to rewrite a page (subfolder) to a new domain without changing the url. I've tried with no luck: ...
0
votes
0answers
155 views

Mod - Rewrite / .htaccess Issue with Apache 2.4.12

The file structure is as follows Public files: /home/usrname/public_html CGI BIN, where the software is running: /home/usrname/public_html/cgi-bin Private files: /home/usrname/public_html/_private ...
0
votes
2answers
129 views

Redirect wildcard subdomain to same subdomain on different domain

I have a domain with dynamic subdomains. The domain, unfortunately, has changed. As such I need to redirect *.domain1.com to *.domain2.com while keeping the subdomains the same. I have looked ...
2
votes
1answer
80 views

Is it possible to enable htaccess for one directory only?

I've investigating performance problems on a website. The software we're using requires htaccess (i.e. it generates .htaccess itself if it's not there, so moving the rules to httpd.conf is not an ...
0
votes
1answer
40 views

mod_rewrite Proxy - maintain host headers

I am using mod_rewrite to proxy a sub-directory like this: RewriteRule ^somedir/(.*)$ http://proxy.example/somedir/$1 [P,L] That means that requests to http://local.example/somedir are proxied ...
0
votes
0answers
69 views

Use mod_rewrite & mod_jk to access different workers

I want to achieve the following: There is one DMZ-proxy over which we want to access multiple application-servers, represented by mod_jk workers. The web-context needs to be the same on all ...
0
votes
0answers
13 views

Mod_rewrite entries in global Apache config disable mod_rewrite in .htaccess [duplicate]

I'm trying to redirect some IPs globally to a specific URL. I've put <directoryMatch /var/www/vhosts/(.*)/httpdocs/> RewriteEngine On RewriteCond %{REMOTE_ADDR} ^111\.11\.11\.[0-9]$ ...
0
votes
0answers
9 views

Apache rewrite to tidy up image urls [duplicate]

I am using the htaccess file that ships with the skeleton application for Zend Framework 2. Here it is: Options -Indexes RewriteEngine On # The following rule tells Apache that if the requested ...
1
vote
1answer
47 views

mod_rewrite activated but error logs

The mod_rewrite is running on my system but I still have an error at the apache2 error_logs. me@server:# ls /etc/apache2/mods-enabled | grep rewrite rewrite.load Content of rewrite.load LoadModule ...
1
vote
2answers
159 views

htaccess redirect loop only on one of two servers

I have a web app installed on two servers. On one of the servers, when I'm accessing the homepage I get the "Error code: ERR_TOO_MANY_REDIRECTS" error in the browser while on the other one everything ...
0
votes
1answer
24 views

Having issues with inconsistent application of mod_rewrite rules

So I've been asked to clean up the URL's for the web app that we're currently running on apache (version 2.4.9 if so interested), but after messing around with mod re_write commands for a few hours, I ...
1
vote
1answer
24 views

httpd forward traffic from a url to another machine on same lan virtual host

I'm running HTTPD on a CentOs 6 server. I have 2 servers on the same LAN as eachother. I only have 1 IP address. I have 2 domains pointing at the router and I want example1.com handled by server 1 ...
1
vote
0answers
28 views

apache2.2: ldap_userdir + mod-rewrite does not work properly

My apache config: DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory ...
0
votes
0answers
49 views

https apache2 rewrite rule returns loop page

I have a rewrite rule that should redirect (http) membership.newref.php to (https) example/membership.newref.php Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ...
-1
votes
1answer
21 views

Godaddy .htaccess and mod_url

I'm an experienced full stack developer and freshly minted webmaster. Recently my client asked me to create a redirect from one url to an outside page. I know how to make a page redirect and I'm ...
1
vote
1answer
86 views

ProxyPassMatch and mod_rewrite order of operation

I've got a situation with Apache 2.4, PHP-FPM and Wordpress Multi user in sub folder mode. All non *.php files work fine in the subfolder, as does the main example.com/subblog/ url, however anything ...
0
votes
1answer
198 views

How To Force Rewrite and Redirect Url [duplicate]

I have a url: http://domain.com/i.php?c=PT and I Rewrote it to http://domain.com/PT successfully. But When I browse http://domain.com/i.php?c=PT, it wont redirect to http://domain.com/PT. Is there ...
0
votes
1answer
684 views

ProxyHTMLURLMap not working in apache2.4

I am using apache2.4 on ubuntu 14.04. And I have enabled mod_proxy_html.But my URL are not getting replaced by a new one. Same thing I did in apache2.2 and it was working perfectly. This is my ...
1
vote
1answer
57 views

Unable to combine RewriteRule and Header set [duplicate]

Trying to implement the following: RewriteRule \.ttf$ - [E=cors:1] Header set Access-Control-Allow-Origin "*.example.com" env=cors:1 Header set Access-Control-Allow-Origin "*.sadface.com" env=!cors:1 ...
0
votes
1answer
134 views

htaccess: get request domain for mobile redirect

We have a mobile site that is served using multiple domains. We want to redirect users who are using desktop user agents to our desktop sites while preserving the original domain the user used to ...
-1
votes
1answer
61 views

Redirect for https and www [duplicate]

I currently have my rewrite rules in the post_virtualhost_2.conf file this in inserted into the httpd.conf file at the absolute end. I have two blocks that don't seem to be working <IfModule ...
1
vote
0answers
59 views

Special nginx hotlink protection conversion from Apache .htaccess rule

I have the following anti-leeching rewrite rule in Apache, which i'd like to have in nginx. I see cookie or referrer rule examples. But none combining both, so I am not sure how to go about this. ...
0
votes
1answer
42 views

How do I transparently redirect only the root directory on a DreamHost.com shared server? [duplicate]

The following DreamHost wiki explains how to transparently redirect your root directory to a subdirectory.. http://wiki.dreamhost.com/Transparently_redirect_your_root_directory_to_a_subdirectory The ...
0
votes
1answer
125 views

How do you prevent mod_rewrite from decoding a string in the path? [duplicate]

I'm trying to create a restful API using mod_rewrite. I have the rule: RewriteRule v2/(.*)$ v1/index.php?request=$1 [QSA,NC,L] However the path could contain base64 encoded strings (i.e. can ...
1
vote
0answers
168 views

Use custom environment properties from Elastic Beanstalk for htaccess

Is there a way to use the custom environment property of elastic beanstalk in htaccess? I only want to rewrite http to https when not running locally so I thought I could do this by using the ...
0
votes
1answer
52 views

mod_rewrite not acting as expected — missing path info

I've just installed a fresh apache (Apache/2.4.7 - Ubuntu) and created and enabled a site with a Document Root of /var/www/html. With mod_rewrite enabled, I proceeded to create a simple .htaccess file ...
-1
votes
1answer
69 views

symlink to PHP file not handled as PHP

I have PHP5 installed on an Ubuntu 14.04 server and it works fine. I create a file called foo.php anywhere in the document tree and it gets passed to the PHP interpreter just as you'd expect. ...
0
votes
1answer
55 views

mod_rewrite: strange infinit loop [duplicate]

I have a folder structure, like this: forum .htaccess [some more files] forum_english .htaccess [some more files] forum/.htaccess looks like this: RewriteEngine on RewriteCond %{HTTP_HOST} ...
0
votes
0answers
44 views

Apache HTTP to HTTPS Redirection on none HOST NAME

I'm not able to get a corect redirection from http to https on every url on my Apache on Centos. I got this in the httpd.conf: LoadModule rewrite_module modules/mod_rewrite.so NameVirtualHost *:80 ...
1
vote
1answer
73 views

Apache2.4 mod_rewrite won't redirect me to subdir based on visiting domain

I have an Apache2.4 server with public dir in /var/www/html. In that dir I have a Wordpress site with this .htaccess: RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f ...
1
vote
1answer
50 views

mod_rewrite date subfolder not working

I am having a strange issue that I am perplexed on. I will prelude with that regex is not my strong suit. I need feedback from the community to get this going. If I have the following URL: ...
1
vote
1answer
121 views

Denying a User-Agent in apache that uses mod_proxy

I want to prevent web crawlers from using an apache site that is configured to forward all requests to a ProxyPass. I have tried the BrowserMatchNoCase directive to set an environment variable ...
0
votes
2answers
70 views

How to rewrite URI from root if file doesn't exists in folder?

I have a static folder which is not in my document root. I would like to redirect all the files that are not present in document root, but are present in the static folder. (So if the same file is in ...
1
vote
1answer
33 views

How to point at all subdomains of a secondary domain to the main domain

I have a secondary domain name which I need its subdomains to point to my main domain. For example,If my main domain is example.com, then I have used example.org to point to the former. What I desire ...
0
votes
0answers
70 views

RewriteCond and LocationMatch

I am running a Magento instance and am trying to tune the browser cache headers appropriately. All requests should have cache headers set, except for the checkout pages (any url that like ...
2
votes
1answer
177 views

CentOS 7 / Apache 2.4 / FastCGI Configuration

Does anyone know how to properly configure PHP/FastCGI on a CentOS 7 machine using Apache 2.4? In the Apache Virtual Host config file, I have this: <FilesMatch \.php$> SetHandler ...
0
votes
1answer
98 views

Reverse proxy Apache rewrite rule doesn't work

I've an apache reverse proxy and i try to make a rules for redirects few urls of example2 to example1 but my rewrite rules doesn't work. I've try this in the vhost of example2 : ProxyPass / ...
0
votes
1answer
36 views

Test file existence outside DOCUMENT_ROOT

I have this .htaccess file inside DOCUMENT_ROOT where it checks for the existence of a file, maintenance.enable and serves maintenance.html if it is present: <IfModule mod_rewrite.c> ...
0
votes
0answers
18 views

Apache mod_rewrite with proxy to HTTPS from HTTPS host

I am trying to use the mod_proxy to rewrite internal one URL to another in this way: RewriteCond %{HTTP_HOST} ^www\.domain\.de$ RewriteCond %{SERVER_PORT} ^443 RewriteRule ^blog/(.*)$ ...