URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
366 views

URL rewriting and SSL conflict

I am facing following problem. URL rewriting with .htaccess is working perfectly on HTTP URLs. Now I have installed SSL Certificates on my server and now accessing my site with HTTPS URLs. Site is ...
1
vote
2answers
79 views

mod_rewrite to redirect to different virtualhost

The hostname where I want to redirect to looks like: <VirtualHost *:80> ServerName my.dav.hostname.com ErrorLog /var/log/open-xchange/dav-err.log TransferLog ...
1
vote
2answers
1k views

Can I mod rewrite to a different document root?

Given a URL: http://example.com/some-file.zip The document root for example.com is /var/www/example.com/ I want apache to: 1) If /var/www/example.com/some-file.zip exists, serve it. 2) If ...
-1
votes
1answer
42 views

Redirect a dynamic URL with Apache [closed]

I need to make a Apache rule to redirect an specific URL http://www.domain.cl/section.do?one.second=8 --> http://www.newdomain.cl/ I was reading about using mod rewrite but all the examples i found ...
0
votes
0answers
48 views

mod_rewrite rule should be matching, but isn't [duplicate]

I've only started editing rewrite rules a few days ago, before now I'd copy and paste them for each case. I've written a rule which as far as I can tell*, should be matching but isn't RewriteRule ...
0
votes
1answer
47 views

relative links to third party proxied domain still point to old domain

I have a proxy rule pointing www.example.com/support to our third party support site (www.support.example.com/support). Looking at the page source, the links are all relative example: <a ...
0
votes
1answer
47 views

Redirecting SSL Traffic to Non-secure site

I am currently running a website on a shared server (Hostgator). The site does not have an SSL certificate and doesn't really need it since it is just informational. However, I've noted that a few ...
0
votes
1answer
130 views

Implementing Toro Required htaccess Rewrite on Windows Server IIS

I'm installing ToroPHP (PHP routing class) on my server. However, it happens to be my first windows server, I'm trying to learn it. Here is the required ModRewrite code as if it was an Apache server ...
0
votes
1answer
167 views

Why does my RewriteCond match even though the pattern clearly doesn't match?

Take a look at my rewrite log: (2) init rewrite engine with requested uri /bundles/astrupsspectacle/spectacle.css (3) applying pattern '^(.*)$' to uri '/bundles/astrupsspectacle/spectacle.css' (4) ...
1
vote
1answer
678 views

Why is my rewrite rule resulting in “400: Bad Request”?

I have these rewrite rules in my site configuration: RewriteEngine on RewriteRule ^app.php - [L] RewriteRule ^(.*)$ app.php$0 [L] The goal is that all requests should be appended to the front ...
0
votes
2answers
32 views

Apache url rewrite not working

Currently I can access my url in this way. xxxxxx.com/index.php/login But I want to make it to xxxxxx.com/login So I used the following rewrite sequence RewriteEngine on RewriteCond ...
1
vote
1answer
300 views

htaccess - Wildcard subdomains to subfolders

So the idea is that I have: domain.com/.subdomains/domain1 (2,3,4,etc) And I want to map: domain1.domain.com -> domain.com/.subdomains/domain1/ domain2.domain.com -> ...
1
vote
1answer
4k views

How to pass a request from one apache server to another

I have two Apache Servers with mod_proxy enabled. I want to know how to "pass the request" from "Apache Server A" to "Apache Server B" using the same port (80). In "server A" with internal ip: ...
1
vote
0answers
112 views

Mass virtual hosting and subdomain

I'm trying to setup zero-config web-development environment: wildcard DNS plus dynamic virtual hosts. Here is my v-hosts config: NameVirtualHost *:80 <VirtualHost *:80> ServerAlias *.dev ...
0
votes
0answers
23 views

mod_rewrite config works for any language except Chinese

Currently, I have this configuration in mod_rewrite in apache: RewriteCond %{REQUEST_URI} !-f RewriteCond %{REQUEST_URI} !-d RewriteRule ^([a-zA-Z]{2,3})/?$ /index.html?wtsLang=$1 [L] RewriteRule ...
-2
votes
1answer
23 views

How do I get apache 2 to serve up home directory? [closed]

I have a domain name I have registered and it is currently showing the Apache 2 Test Page from the /var/www/html/ directory, I was wondering how I can get it to point to a home directory instead ie: ...
-2
votes
1answer
96 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.example.com/$1 [R=301,L] It ...
1
vote
0answers
75 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
3answers
135 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
68 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
49 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
241 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
117 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 ...
0
votes
1answer
99 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
52 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
200 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 ...
1
vote
1answer
1k 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 ...
-1
votes
1answer
221 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
370 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. ...
1
vote
1answer
3k 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
77 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
51 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 ...
1
vote
0answers
31 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 ^(.*)$ ...
3
votes
1answer
900 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
105 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
25 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
36 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
70 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
64 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
460 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
128 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
197 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
84 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
629 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
64 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
3answers
4k views

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

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
2k 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 ^(.+)/$ ...
7
votes
3answers
969 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
96 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
49 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 ...