URL rewriting module for Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
33 views

Inspecting apache mod_rewrite

I want to do something simple with apache mod_rewrite. And guess what, it doesn't work. Had I been in a "sane" environment, maybe I would get an error and a stack trace. Or maybe I could use a ...
0
votes
2answers
1k views

Using Apache httpd to redirect context path?

I'd like to proxy http://localhost:1006/ as http://example.com/public/ to the outside world. Here is my configuration: RewriteEngine On # Append a slash if necessary RewriteRule ^/public$ public/ ...
1
vote
1answer
269 views

Apache as a proxy fowarder to dynamic IP

I've looking aroung the web, but I can't figure out how to do what I'm looking for. So what I'm looking for is a proxy on which will foward the HTTP query based on the IP address I've put in the url ...
3
votes
1answer
65 views

Secure Apache when using mod_proxy_http and mod_rewrite

We have an Apache server that works as a proxy for apps running on different ports. For example: domain.com/app1/service1 > localhost:101 domain.com/app1/service2 > localhost:102 ...
4
votes
3answers
1k views

How do I create a custom header from an existing SSL environment variable?

OK I have spent all day on this-- I'm using apache with mod_ssl I'm trying to take an existing environment header, "%{SSL_CLIENT_S_DN_CN}s" which looks like "Lastname Firstname Mi username" and set a ...
0
votes
2answers
6k views

Removing php extension with .htaccess does not work

I use the following code on my site elixnews.com to remove php extension from: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
1
vote
1answer
354 views

trac: “Internal server error (500)” with mod_fcgid and mod_suexec

I try to setup Trac on a shared server with shell access, SW is Trac 1.0.1, Python 2.6.6, Apache 2.2.15 with mod_fcgid and mod_suexec. I've set it up following the instructions from the wiki of my ...
0
votes
1answer
16 views

Issue with mod rewites in htaccess on Apache

I am using a private host, linux php, where the htaccess just does not act like it does with the bigger famous top 10 hosts etc. redirect 301 /pagea.html /pageb.html Causes a 500 internal error on ...
-1
votes
3answers
59 views

RewriteRule doesnt work [duplicate]

I want to convert this url http://ts.thebenamorgroup.com/g2g/category.php?cate=mens to: http://ts.thebenamorgroup.com/g2g/category/cate/mens/ I have this rule but it doesnt work: Options ...
0
votes
2answers
548 views

RewriteCond RequestURI why RegEx doesn't work?

i have a working RewriteCond like: RequestURL: http://www.myserver.com/images/gallery/summer/2013/2013-07-07/thumbs/001.jpg RewriteCond %{REQUEST_URI} !images/gallery/summer/2013/* RewriteRule ...
1
vote
1answer
289 views

Debugging htaccess rewrite rule; 2nd capture group ($2) empty

I've seen this issue crop up for other people, but in their cases, there was an issue with their regex. A quick trip to regexpal.com indicated to me that this was not the case. I have a simple ...
0
votes
1answer
198 views

mod rewrite on apache on virtualhost to point to jboss

I set my apache server with ajp to connect to my jboss server and it is working fine. But when I go to my domain http://mydomain.com, I see the jboss root page. I was wondering if I could use mod ...
1
vote
1answer
128 views

How to store value of a non-standard HTTP request header to be used in an Apache If conditional

My server will be receiving a non-standard HTTP request named EmployeeID that I want to use to determine access rights to certain directories on the server. How can I store the value of the incoming ...
0
votes
1answer
292 views

apache2 mod_rewrite enable, but not working

I have enabled mod_rewrite on my server and confirmed it using phpinfo() and it shows as enabled. I have the following in my httpd.conf file: ServerName 172.16.1.114 RewriteEngine on RewriteRule ...
0
votes
1answer
457 views

Mod_rewrite issue with godaddy web hosting

Am trying to use laravel to build a site but my routes all redirect to the homepage. Apache error logs show this AH00124: Request exceeded the limit of 10 internal redirects due to probable ...
0
votes
1answer
65 views

mod_rewrite capturing domain and tld

I'm using mod_write to rewrite this www.variabledomain.variableext to http://my.com/variabledomain.variableext Note that variabledomain and variableext are really variable, so I can't hardcode ...
0
votes
2answers
207 views

How to simulate Apache [END] flag on a redirect?

For business-specific reasons I created the following rewrite rule for Apache 2.2.22 (mod_rewrite): RewriteRule /site/(\d+)/([^/]+)\.html /site/$2/$1 [R=301,L] Which if given an URL like: ...
0
votes
2answers
441 views

How can I rewrite a URL and pass on the original URL as a parameter?

I'm building a site that needs to include a 'check' procedure, to do several initiation tasks for a user's session. Examples include checking whether they're accepting cookies, determining if their IP ...
2
votes
2answers
3k views

How to Exclude an URL for Apache Mod_proxy?

We have two Apache server as front-end and 4 tomcat server as back-end configured using mod_proxy module as load balancer. Now, we want to exclude an single tomcat url from the mod_proxy load ...
-1
votes
1answer
27 views

Include current rewritten URI in substitution

Without changing my patterns to match the whole string (which would make them a lot more complicated), is there a way to use the current URI in the substitution string? Using %{REQUEST_URI} won't ...
1
vote
1answer
959 views

.htaccess ignored, SPECIFIC to EC2 - not the usual suspects

I run 8-10 EC2 based web servers, so my experience is many hours, but is limited to CentOS; specifically Amazon's distribution. I'm installing Apache using yum, so therefore getting Amazon's default ...
0
votes
1answer
67 views

mod_negotiation and mod_rewrite

I'm trying to configure a URL scheme that a) allows the ".html" extension to be omitted and b) sends 403 (Forbidden) errors under certain conditions. However, with the following setup: Options ...
0
votes
2answers
882 views

Server, Database or Code Issue? Magento backend rewrites itself with a index.php which doesnt work

I will be honest and admit my cross posting in magento.stackexchange.com but the reason is that I believe it is a server fault, and now I am looking for proof to present to my dreaded hosting ...
0
votes
1answer
52 views

Apache url canonicalization with mod_jk

I have the domain domain.gr. I have setup an Apache server with mod_rewrite and mod_jk. <VirtualHost *:80> ServerName domain.gr ServerAlias www.domain.gr ServerAdmin ...
2
votes
1answer
310 views

Redirect https .com to https .co.uk without a valid SSL cert on .com without DNS change

I have an SSL cert valid for the www. and . subdomains on a domain. That's up and working great. All traffic on http redirects to https, and all bare domain traffic redirects to the www. version. In ...
0
votes
1answer
124 views

mod_rewrite some rewriterules not triggering

I am setting up an htaccess file to use some seo friendly urls instead of pointing directly to php files. I have used this method plenty before but this is my first time doing it on a rackspace server ...
0
votes
1answer
3k views

RewriteCond not matching on my IP when matching on %{REMOTE_ADDR} [duplicate]

I want a mod_rewrite rule not to be executed when traffic is hitting the web-server from internal network. The web server is an apache 2.2 The following RewriteCond is meant to guard the rewrite rule. ...
2
votes
3answers
302 views

Forward Apache 500 status to 404

Short version: We'd like Apache to catch when a 500 status is given and return something like 404 instead. Is there a way to do this? Longer version: These servers are running applications that ...
0
votes
0answers
193 views

Is there a way to get a password from HTTP authorization header in mod_rewrite (apache2)

I'd like to parse HTTP authorization header in mod_rewrite - to be able to use login and password for another redirect. I want to achieve something like this: user puts ...
1
vote
0answers
33 views

Mod rewrite to remove a directory

I'm running a PHP web app that has a .htaccess file as below. DirectoryIndex index.php <IfModule mod_rewrite.c> RewriteEngine On #RewriteBase / RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ ...
1
vote
0answers
155 views

mod_rewrite after a cname

I have the domain foo.bar.example.com. foo is one of many sub-subdomains under bar.example.com. I need to capture and redirect all links at foo.bar.example.com that begin with "/special/". ...
0
votes
1answer
82 views

Apache rewrite rule (mod_proxy or mod_rewrite)

I need to rewrite a incoming request for a particular file. The file will have a suffix of .rtfx and I need to remove the host (http://www.host.com/) and replace it with another. Request *.rtfx file ...
0
votes
1answer
89 views

Why does this RewriteRule in httpd not work?

I tried to set this RewriteCond in httpd 2.4.4: ... RewriteCond expr "%{QUERY_STRING} =~ /welcome/" RewriteRule ^(.*)$ %1\.html So, if I visit https://localhost/?welcome , for example, I should see ...
0
votes
1answer
393 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
84 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
45 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
48 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
49 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
134 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
178 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
788 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
435 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
5k 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
120 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
25 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
104 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 ...