URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

-2
votes
1answer
25 views

Redirect HTTPS to HTTP in Apache [closed]

Need to urgently redirect HTTPS traffic to HTTP Looked around at various options and am ending up with: RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^(.*)$ http://www.namerific.com/$1 [R=301,L] It ...
1
vote
0answers
25 views

Conflict with 3 different RewriteRules in .htaccess?

I'm using the below in my .htaccess file. There 3 types of redirects: redirect to directory /admin/index.php redirect to specific .php files e.g. /about redirect to user profile page from /John ...
0
votes
2answers
29 views

Mass virtual hosting: map any portnumber to own domain name

I need to define rule (using mod_rewrite i think) to map any port to portnumber.domain.com. How to do that in Apache2 ? Now i have one config for each port number like below. # 9003.domain.com ...
0
votes
1answer
29 views

htaccess issue - 500 internal error

I have installed an app which has the following rewrite rule. It runs fine in a VPS setup - but in every shared hosting it is showing 500 error. The log is showing "bad delimiter" - I am completely ...
0
votes
2answers
31 views

How to do live.mywebsite.com => mywebsite.com/live via .htaccess?

I need to do the following thing Mapping this subdomain live.mywebsite.com/something to mywebsite.com/live/something for examples : www.live.mywebsite.com/ ==> www.mywebsite.com/live/ ...
1
vote
1answer
31 views

Apache restrict domain [duplicate]

I would like to configure Apache (2.2)to restrict what domains users can access e.g. if apache FQDN is myapache.myfunnydomain.com then apache will only allow requests to resources in ...
1
vote
2answers
20 views

Apache rewrite rule doesn't match in “.htaccess” file

The same Apache rewrite rule works (match) in VHost but not in ".htaccess" file: <VirtualHost *:80> ServerName 192.168.1.100 ServerAlias example.com DocumentRoot /test RewriteEngine On ...
-1
votes
0answers
29 views

Non-Port 80 Web Server & Pretty URLs [closed]

This is a "Blocked Port 80" related question, but maybe something a bit unique. I've yet to find a good answer. It's more academic than anything as I know running a production server at your house is ...
0
votes
1answer
11 views

Redirect apache to http requests to https except for when request is a POST?

I have setup my apache2 configuration to redirect http requests to https. This works fine however I want to change it so that it only does this if the request is not a POST request. Here is my ...
0
votes
2answers
22 views

RewriteRules not stopping with [L] flag?

A simpel mod rewrite in .htaccess. If I open for example /lib/js/core/jquery.min.js, Apache2 takes the last rule and not the first. How can I fix this? RewriteEngine on RewriteRule ...
1
vote
1answer
22 views

why is my mod_rewrite redirect only working for the requested page and not it's necessary css, js files?

I'm trying my first steps with setting mod_rewrite to make the URLs of an application a little nicer. I have a skinnable system, with skins being set through a query parameter, so any of the ...
0
votes
1answer
33 views

Masking the URL in a mod_rewrite

Is there any way of doing a mod_rewrite from one domain to another, but keeping the browser URL the same throughout? This is what I want: User enters something like bacon.com and ends up on ...
0
votes
1answer
24 views

Apache rewrite rule infinite loop for subpage [duplicate]

I am trying to redirect toast.allthesmarts.com to toast.allthesmarts.com/dayone RewriteEngine on RewriteCond %{HTTP_HOST} toast.allthesmarts.com RewriteRule ^(.*)$ ...
0
votes
1answer
28 views

.htaccess RewriteRule with cookies not working

The Joomla CMS Platform has an /administratotr/ folder which cannot be renamed. I'd like to secure it by requiring a custom url parameter to access it - I.E. /administrator/index.php?token=1149785380. ...
0
votes
0answers
10 views

Clone/duplicate cookie with different path

I would like using mod_headers module in Apache to clone/duplicate cookie with name 'lang' with different path. More precisely I've got cookie "lang" assigned to "/man/" and I would like to clone ...
1
vote
1answer
47 views

SSL setup with apache in front of tomcat

i m trying to setup Apache with SSl and proxy SSL requests to my tomcat instance. I think i made the SSL work but theres still a error that shows up: Bad Gateway The proxy server received an ...
0
votes
2answers
42 views

.htaccess - complicated conditions

I've been trying to wrap my head around .htaccess for most of the weekend, but I keep stumbling; I can get the server to work with one set of rules, but no more than one at a time. My application is ...
0
votes
2answers
36 views

Advice on mod_rewrite url in Apache

I'm trying to set up a mod_rewrite rule so that when the webpage www.mysite.com/blog is requested a page from the blogging service Tumblr is loaded. I have set up my Tumblr site so that ...
0
votes
0answers
12 views

How can I use mod_rewrite RewriteLock (for RewriteMap “prg”) under Apache MPM-ITK?

We have used Apache MPM-ITK for privilege separation for several years now. It works well for our needs, but recently we tried to host a PHP application that needs to define a RewriteLock for ...
1
vote
0answers
25 views

Rewrite not functioning in httpd.conf

My httpd.conf has: <Directory "/var/www/site"> AllowOverride All RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^site.com [NC] RewriteRule ^(.*)$ ...
2
votes
1answer
38 views

How to redirect all non www and http traffic to www and https with Apache2

In my httpd.conf, I have RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^mysite.com [NC] RewriteRule ^(.*)$ https://www.mysite.com/$1 [L,R=301] But that's not working properly. I want the ...
0
votes
1answer
26 views

Forward http to https expect one folder results in mod_rewrite error 310

My .htaccess RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=302,L] RewriteCond %{SERVER_PORT} 443 RewriteCond %{REQUEST_URI} /docs/ [NC] RewriteRule ^(.*)$ ...
0
votes
1answer
20 views

Apache Rewrite rule is rewriting for /libs even though its exlcuded in the rewriteconditions

<IfModule mod_rewrite.c> RewriteEngine On RewriteLog "/private/var/log/apache2/rewrite.log" RewriteLogLevel 3 RewriteCond %{REQUEST_URI} !^/etc$ [OR] RewriteCond ...
0
votes
1answer
31 views

Understanding mod_rewrite syntax

When I write in .htaccess this mod_rewrite RewriteEngine on RewriteRule ^(.*)\.my_extension$ $1.php and open url: site.com/index.my_extension this wroks fine, opened index.php But when I am ...
0
votes
1answer
32 views

Converting .htaccess to nginx

RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) p.php?id=$1 [L,QSA] How would I change that to work with nginx? Also, where do I place ...
0
votes
2answers
16 views

Two different applications (Heroku and EC2) on the one domain name

Is it possible to point my Heroku application to https://myawesomeapp.com and my EC2 wordpress server pointing to http://myawesomeapp.com ?
0
votes
1answer
49 views

Infinite loop with VirtualDocumentRoot, .htaccess and mod_rewrite

I want to set up robust multiuser development environment with apache2. So I placeed the following file to etc/apache2/sites-available/mydomain.com <virtualhost *:80> ServerName ...
0
votes
0answers
25 views

problems mod_rewrite for a root document

I thought I had a minimum of understanding about how mod_rewrite works but, it's like sendmail, I'm always a step beyond (or even further!) :-( I have summarized what I want to do in the following ...
0
votes
1answer
34 views

Unable to enable Apache re-writing

Apache newb here. Ultimate goal is use Apache as a reverse proxy (got that working) and append a particular value to a query string (can't get it working) via mod-rewrite. The string in question ...
0
votes
2answers
53 views

Apache as reverse proxy more resources

I'm moving a big directory of images from an HTTP server to another and I cannot change any configuration. I would like my user don't even suppose that a moving in progress. So I thought to add an ...
1
vote
1answer
57 views

How to block all incoming proxy visits except from one specific I.P?

I have a page that is prone to attacks, so, in order to reduce the anonymous attacks, I use this code in my .htaccess which I found online : # BLOCK PROXY VISITS <IfModule mod_rewrite.c> ...
0
votes
1answer
46 views

Mod_rewite - do these rewrite rules work?

Help, please. Can you tell me if this is the correct code to perform the following rewrites? I can't test this particular change like I would like. This company has four domains in a single ...
0
votes
2answers
45 views

How do I make RewriteCond %{HTTP_COOKIE} match a cookie value exactly?

How do I make my rule match an exact value of a cookie? I've tried: RewriteCond %{HTTP_COOKIE} ^its=me$ [NC] RewriteCond %{HTTP_COOKIE} its=^me$ [NC] RewriteCond %{HTTP_COOKIE} its="me" [NC] ...
0
votes
1answer
57 views

htaccess rewrite gives LimitInternalRecursion error

I have a .htaccess file with the following code <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ ...
4
votes
2answers
32 views

RewriteCond file-exists check fails for existing files

I have a weird scenario with this rewrite rule: RewriteCond img/$2/$3/$4/$1 -f RewriteRule ^img/(([a-z0-9]{4})([a-z0-9]{4})([a-z0-9]{4})[a-z0-9]{28}\.\w+)$ img/$2/$3/$4/$1 [L] The directory ...
1
vote
2answers
47 views

Apache/Tomcat Redirect

We have a Tomcat application from a vendor running with Apache in front of it, but we don't have access to the application code. We have our own single sign on wrapped around the application, so if a ...
0
votes
1answer
22 views

mod rewrite of query strings [duplicate]

Say I wanted http://domain.com/product/?id=123 to become http://domain.com/product/foo, how do I do that in .htaccess? I tried something like this, but it didn't work: RewriteBase /fisher RewriteCond ...
0
votes
1answer
33 views

Can mod_rewrite distinguish between 'user' request and internal redirect?

Simple question really. After an internal redirect, the original 'context' is gone. I'd like to know if there is a variable or flag that allows me to check against the original request instead of the ...
0
votes
1answer
23 views

Redirect domain to app

I want to be able to use custom domains for my application. For example a customer purchases a domain lets call it example.com and I want that he can use the domain on myapp.com How can I achieve ...
0
votes
1answer
31 views

apache rewriterule for querystring parameters

The code below builds a url in this form. http://mysite.com/browse/department/?pid=1 and here is the rewrite cond and rule RewriteCond %{QUERY_STRING} ^pid=([0-9]+) RewriteRule browse/(.*)/$ ...
0
votes
1answer
48 views

apache simple rewrite rule or rewrite condition for query string

Im trying to add a rewrite rule to my htcaccess file and the part Im having trouble wth is the query string. I want to add the query string parameter pid to the rewrite rule. Both lines of code don't ...
0
votes
1answer
29 views

HowTo rewrite subdomain to apache userdir

As described in http://cjmaclachlan.blogspot.de/2008/02/modrewrite-moduserdir-subdomains-and.html I want to rewrite internally http://xy.user.phpfarm.lan -> http://user.phpfarm.lan/~xy/ userdir is ...
0
votes
3answers
34 views

The Apache mod rewrite module doesn't work when using the IP

I've got a Drupal setup locally. When I access the homepage using my IP everything works. When I try any "re-written" url (such as 10.0.150.4/user) I get a not found. When I replace my IP with an ...
0
votes
2answers
79 views

Change port and host using .htaccess

I am trying to use mod_rewrite to basically port forward a port on a subdomain to another port on another IP. Like this: sub.website.com:2000 --> 123.45.67.891:3000 How could this be ...
0
votes
0answers
54 views

mod_rewrite in .htaccess w/ wildcard virtual hosts - preserving subdomain while funneling requests through index.php

I have a project which utilizes wildcard subdomains to allow requests for www.foo.com, api.foo.com, & admin.foo.com to utilize the same document root. Routing for this project is based initially ...
1
vote
0answers
223 views

“ajp_read_header: ajp_ilink_receive failed”

We have Apache 2.2.24 in front of Tomcat 7.0.33. We're using AJP connectors with APR/native configured. I recently noticed a number of 500 errors in the Apache access logs for a small proportion ...
0
votes
1answer
110 views

how to make a url rewrite rule exception?

I have a bunch of rewrite rules to redirect visits from domainX to domainY, however now I want show an index.html page when people visit domainX, but I still want all the other rewrite rules to apply. ...
0
votes
1answer
33 views

Lighttpd mod_rewrite to Apache mod_rewrite

I want to turn this Lighttpd mod_rewrite to apache rewrite code. $HTTP["host"] =~ "^(i\.ylar\.se|puush\.me)$" { server.document-root = "/var/www/servers/i.ylar.se/" url.rewrite-once = ( ...
1
vote
2answers
44 views

mod_rewrite: rewrite existing file to slug, slug to existing file

My situation is as follows: I have static files in folder public/ on my local server. Any request that comes in should be forwarded to that folder, but if a file in that folder is accessed directly, ...
-2
votes
1answer
23 views

Moving WP blog to Tumblr but still use old WP server's images? [closed]

I've successfully moved my old WP blog that I hosted on my server to a Tumblr blog by using the CNAME to point to it. However, all of the Tumblr blog's photos are still hosted on my old WP blog, so ...

1 2 3 4 5 24