URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

1
vote
0answers
13 views

Use different client IPs with mod_rewrite and mod_remoteip

I have a reverse proxy that my site points to to help with DDoS protection. I have mod_rewrite set to use a specific header provided by the reverse proxy in order to pull the actual client IPs instead ...
-1
votes
1answer
14 views

apache: prepend a string literal to a TestString in a RewriteCond for mod_rewrite [duplicate]

So I can clearly do this: RewriteCond %{REQUEST_FILENAME}\.php -f But I cannot do this: RewriteCond some_directory/%{REQUEST_FILENAME}\.php -f Furthermore, this also fails: RewriteCond ...
-1
votes
1answer
27 views

How to mask one of my domains to another?

I want one of my domains (freelawofattractioncourse.com) to point to another site of mine (http://katievb.com/freecourse) without causing the URL to change in the address bar. In other words, when a ...
0
votes
1answer
16 views

mod_rewrite sending redirect loop when trying to redirect based on user agent

I am using Apache 2.2.3 (old version, I know) So I am trying to redirect based on older versions of IE (6 and 7 for now... ) and I am getting a redirect loop. I have: RewriteEngine On RewriteCond ...
0
votes
0answers
12 views

Redirect from different domains on SSL without URL rewriting

Problem I have two domains hosted on hostgator (on different servers): Domain A is using cloudflare for DNS and flex SSL. This is hosting a product page with info about product. Domain B is using ...
1
vote
1answer
25 views

Conditionally serving files from a directory outside of the document root with Apache2

I have inherited a web application written in PHP. The code is not the best and I want to start using the Symfony framework. It will be a gradual migration through several releases so I need the ...
1
vote
0answers
16 views

Redirect rules for .htaccess with mod_rewrite

I have a PHP script dynamically generating content from a database based on queries. The user might do a search from a text box for the username "mark". The content is provided by PHP at ...
2
votes
1answer
11 views

404 when trying to shorten url for mediawiki (lighttpd)

I'm absolutely new at this, so please bear with me. I installed mediawiki on lighttpd with no problems, except that when I try to follow up redwerks instructions on how to shorten the urls for ...
0
votes
1answer
14 views

How to write more than one mod-rewrite rule?

I always used the following rule to manage urls: Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^.*$ ./urlredirect.php ...
0
votes
0answers
12 views

Apache 2.4 mod_rewrite on vhost_alias

i have configured apache as dynamic mass virtual hosts. I have serval applications writen in symfony2 with .htaccess Vhost looks like this: <VirtualHost _default_:80> ServerAdmin ...
0
votes
1answer
19 views

Some mod_rewrite syntax clarification

We inherited some code recently and I'm reviewing the .htaccess file of one of the sites. I understand what the end result of most of the rewrite rule sets are, I'm just unsure of some of the syntax. ...
0
votes
0answers
16 views

Combine modrewrite condition to avoid double redirects

There are two modrewrite directives in my htaccess file. One is redirecting uppercase URLs into lowercase. The other one is redirecting http and www requests to https and none www. #Redirects ...
-1
votes
0answers
12 views

301 redirect not working as expected [duplicate]

i've set some redirects in my htaccess file, this is what i got so far: RewriteEngine On Options +FollowSymLinks Redirect 301 /products http://www.newdomain.com/sm/folder/ the old ...
0
votes
0answers
5 views

Apache config with rewrite causes loop [duplicate]

I have to port a WebApp to a new server. On both servers I use the Apache 2.x webserver. I have to redirect every user from m.domain.com/$restOfPath to m.domain.com/mobil/$restOfPath. With ...
1
vote
1answer
15 views

How can I force mod_rewrite to send user info component of a URI?

A colleague recommended I repost this from StackOverflow to ServerFault: This has been driving me crazy. I have a web application that's being served via Apache Web Server. The database server that ...
1
vote
0answers
16 views

Apache rewrite not finding path

I am trying to rewrite an internal path for specific requests. I have the following URL: ...
2
votes
2answers
114 views

RewriteRule for root without the R flag is not working

I'm trying to do a cache system with files. And I was thinking of using mod rewrite to serve the cached file if it exist, or the php file (that will create the html static cache) if not. Here is the ...
1
vote
1answer
42 views

Apache (httpd) VirtualHost RewriteCond Variables not working

I am trying to make a dynamic virtual host entry with the intent of redirecting all traffic to .mydomain.com to /var/www/html/ this part works but I also what a Rewrite conditions that checks if the ...
0
votes
0answers
12 views

Set 1 cookie on 2 different subdomains

I am trying to get one cookie to work with 2 domains. Currently using an agreement page once a users first views the website that it will come up and they have to accept the ToS to continue, however ...
1
vote
2answers
20 views

rewrite refuses to work

I want to rewrite this url: http://cyanogenupdatetracker.com/api/v1/show_devices.php to http://cyanogenupdatetracker.com/api/v1/devices I used this .htaccess file Options +FollowSymlinks ...
0
votes
0answers
57 views

Apache Allow Override Not Working with Docker Container

To sum it up; I can't get httpd.conf AllowOverride to work inside a CentOS:6.6 Docker Container. It completely hides the alias directory to any browser. I know it is not permissions and it is not ...
0
votes
1answer
28 views

Stop processing and return to client immediatly in Apache

I have a Apache 2.2 that hosts a proprietary (commercial) authentication module. That modules looks at every requests and might let them through if they are flagged and "anonymous ok" in the back-end ...
0
votes
0answers
30 views

Problems loading CSS. Error.log prints: “Request exceeded the limit of 10 internal redirects”

I have issues on my server. When I do changes to CSS file they are not showed until one day later or more. I have seen the following error in the apache error.log: [Thu Jul 16 08:48:49.193132 2015] ...
0
votes
1answer
42 views

apache mod_rewrite rule not working [duplicate]

I'm testing the rule below else where and it's working but on my system it's not (centos 7, Apache/2.4.6) [I changed my domain to domain.com for the post here] the purpose of the rule is to rewrite ...
0
votes
1answer
30 views

Remove double URL encoding on URL

I have a third-party shopping cart set up on my server using PayPal for payments. When a user completes a transaction they are redirected to the URL ...
0
votes
0answers
28 views

Apache redirection to domain (both Http and https)

I'm trying to redirect some urls in http and https to a new subdomain. For example: http://myurl.com/one/two/three -> http://newsubdomain.myurl.com/one/two/three https://myurl.com/one/two/three ...
0
votes
0answers
13 views

mod_rewrite leads to 404

I'm trying to redirect (internally) example.com/snippets/_filename_ to example.com/snippets/?f=_filename_ using mod_rewrite... And it is not working. The contents of my .htaccess file, which is ...
0
votes
2answers
73 views

Wordpress shows permanent loop redirect after upgrading from Apache 2.2 to Apache 2.4

I've upgraded my Apache 2.2 web server to 2.4 today and then some Wordpress installations started to get infinite loops from non-www to www and from www to non-www :( Removing .htaccesss didn't ...
0
votes
0answers
49 views

Haproxy and rewrite rules issue?

I have HAproxy listening on port 80 to send requests to a node server (port:3000) or php server (4000). The following rewrite rules should add a trailing slash to any url that is pointing to an ...
0
votes
1answer
95 views

Nginx url rewrite file not found

I have converted my .htaccess to work with Nginx but i have many 404 errors or wrong display for folder and subfolder rewriting. This Nginx config works for folder and subfolder but for /view/ its ...
0
votes
1answer
19 views

Redirect all vhosts when a certain condition is true

I am trying to redirect all vhosts to a certain url based on the REQUEST_URI. For example if somebody makes a request to www.something.com/condition on my server to be redirected to google.com I ...
0
votes
0answers
41 views

Replace all matching characters in a parameter value with mod_rewrite?

I am attempting to change all the space characters to a + in the token URL parameter value but I'm only getting the first occurrence to change. I have a 3rd party sending me a POST with unescaped + ...
0
votes
0answers
10 views

Denying access to autogenerated file in Apache and Magnolia

I have several virtualHosts in a machine with magnolia working on it. Magnolia auto-generate a sitemap's file so I'm trying to deny its access with Apache 2.4 I've tried this: <FilesMatch ...
0
votes
1answer
22 views

htaccess rewriting same page names conflict

My htaccess file has the following two lines RewriteRule ^payment payment.php RewriteRule ^payment-confirmed payment-confirmed.php When trying to access payment-confirmed.php it just goes to ...
1
vote
1answer
83 views

Apache Redirecting All Sub directory Sub Folders Back to Root Directory [closed]

I have a website stored in a root folder. example.com correctly brings me to the website stored in /var/www/mainsite. I want to put multiple websites in sub folders. so example.com/website1, ..2, ..3 ...
0
votes
0answers
68 views

Match subURIs to index.php file on Apache Passenger

I have the following configuration within a VirtualHost block: #Passenger config DocumentRoot /home/me/railsapp/public <Directory /home/me/railsapp/public> AllowOverride all Options ...
1
vote
1answer
17 views

mod_rewrite not working on web root dir

With the Apache/mod_rewrite config below i get a 403 forbidden error for any CGI scripts on the root /var/www/ I don't get any error for static files. Scripts out of root dir i.e. ...
0
votes
1answer
31 views

“deny all” for all files in a directory

My server is getting hit hard by bots, etc., looking for various files in /cgi-bin/, like search.cgi, YaBB.pl, gitweb.perl, perl, gitweb.pl, htsearch, and on and on. I want to deny all access (send a ...
0
votes
1answer
45 views

Allow Parent .htaccess to redirect all assets

We're migrating from one subdomain to another. This particular domain has a subset of several websites. I've setup the following rewrite to handle the redirect globally: In docroot/.htaccess ("Rule ...
0
votes
1answer
38 views

Mod_rewrite rule to force use of particular domain name for a specific directory

I'd like to force the use a different hostname/domain name for a particular directory on my site. Currently, there is a directory that contains several webpages at mainsite.com/directory. For the ...
0
votes
1answer
91 views

Apache 2.4 mod_rewrite in Vhosts not working in WAMP local server, but working in .htaccess

I had some mod_rewrite rules in Apache 2.2 local dev server and they were working fine. Now After upgrading to Apache 2.4, I am trying to do a simple mod_rewrite rule and it is not working. It is ...
1
vote
0answers
21 views

Converting .Htaccess Rewrite Rule to Nginx

I have the following apache rewrite rule which I am trying to convert to work with nginx. RewriteRule ^(.*)\/(.*)-(\d{4})(?:-(.*))?$ album.php?artist=$1&album=$2&releaseyear=$3&extra=$4 ...
2
votes
2answers
201 views

.htaccess Lost SESSION after header redirect using mod_rewrite [L, QSA] with started session

PHP version 5.4.41 Apache version 2.2.15 Linux version 2.6.32 CentOS 6.6 I have some code that won't redirect properly. There is a lot of code and configuration, so I'm going to try and keep it as ...
1
vote
2answers
69 views

Combine http to https and domain redirects using mod_rewrite

I'm trying to redirect www.example.com to a hosted blog at https://www.example.wordpress.com. The domain redirect works, but gives me a 403 error because it's redirecting http to https. Example.com is ...
0
votes
0answers
56 views

Is there a way to redirect HTTP to HTTPS using mod_proxy_ajp or this could be done only at mod_rewrite side?

What is the easiest way to redirect http to https when mod_proxy_ajp is used? I have the configuration below for mod_proxy_ajp: ProxyPass /home ajp://localhost:8080/home ProxyPassReverse /home ...
0
votes
0answers
38 views

fallbackresource vs htaccess which one?

I have a website that uses .htaccess file. After digging for a problem I had, I found that I can use FallbackResource. It makes everything way simple on the apache configuration but more work on the ...
0
votes
1answer
30 views

mod_rewrite - detect a GET Request URL and render index.php

Sorry for the 1000000 topic on this, but I've been trying and searching for hours and couldn't find anything. Basically, I have already used mod_rewrite to allow someone to type in ...
0
votes
0answers
44 views

apache rewrite rule to a file out of DocumentRoot

[Ubuntu14/Apache2.4] I would like to use a Rewrite rule to a file out of DocumentRoot: RewriteEngine On RewriteRule (.*).abc /etc/myproject/myfile.php?File=$1.abc [NC,L] But, I can't because ...
0
votes
0answers
18 views

redirect/proxy subfolder to different server

I was hoping someone could tell me the best way to achieve the following. I need to redirect a subfolder of a Wordpress site to a different server, while keeping the URL intact. I've tried a few ...
1
vote
1answer
107 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 ...