I have changed to mod_filter from AddOutputFilterByType and now cannot rewrite the body content of a 302 page. I can rewrite the Location header using mod_headers, but I need to modify the informational content of the 302 page (usual a href "page has gone here") message as the source app puts internal details on the page.
we're using IIS 5.0 which doesn't have any flexible support for rewriting URLs which include parameters (AFAIK, anyway). We're currently testing an ISAPI Rewrite Plugin, which emulates the syntax and behaviour of mod_rewrite, which is why I felt this forum category to be the most appropriate for this post.
Our URLs at the moment look like:-
[url]where 'hg' is an instance of a key. In this particular example, we wish to rewrite our URL to read [url]homegarden' where 'homegarden' is a value of that respective key.
Since the value 'homegarden' isn't present in our current URL, we need some way to associate this value with it's relevant key, by mapping one to another. The ideal solution in this case would be to use RewriteMap, however the ISAPI plugin doesn't support this directive.
One other solution, that I've seen here is to use the 'homegarden' value as the key instead. However, due to the lack of flexibility of our system, this isn't possible.
Another method of achieving this is to hard-code a RewriteRule for every instance of a key, but this solution has obvious performance drawbacks (we have around 400 categories)
So, at the moment I'm out of ideas, which is why I thought I'd try and rack your brains for suggestions. An ideal scenario would be to use something like RewriteCond (which is supported by the plugin) to attach a file which would contain the key/value map.
My server was running a cronjob backup, and my apache always fail
root@b# service httpd restart /etc/init.d/httpd restart: httpd not running, trying to start /etc/init.d/httpd restart: httpd started root@b# service httpd restart /etc/init.d/httpd restart: httpd not running, trying to start /etc/init.d/httpd restart: httpd started root@b# service httpd restart /etc/init.d/httpd restart: httpd not running, trying to start /etc/init.d/httpd restart: httpd started
I can only restart them on my CPanel WHM
Attempting to restart httpd Waiting for httpd to restart.... . . . . . . . . . . finished.
httpd status root 5805 0.8 0.9 21092 19504 ? S 22:39 0:00 /usr/local/cpanel/whostmgr/bin/whostmgr ./reshttpd root 1012 4.0 0.6 23348 13828 ? Ss 22:39 0:00 /usr/local/apache/bin/httpd -DSSL
httpd started ok
root@b# service httpd restart /etc/init.d/httpd restart: httpd restarted
At times as I'm developing, due to some coding error in PHP on my part, particularly calling a COM object, the apache server crashes. I'm delighted that it recovers, but in so doing it always tries to rerun the query that crashed it, which just causes another crash, and so on. Is there some way of getting round this, so that it recovers but the problematic code is not rerun?
XP SP3 (still!) Apache/2.4.3 (Win32) mod_fcgid/2.3.7 PHP/5.4.9 Firefox (Aurora)
I am trying to setup a pass through on our apache proxy server, typically this is not any trouble but our developers have started using a product call DEV EXPRESS and I cannot figure out how to get my pass through to work. Here's what my pass through looks like
ProxyPass /tmsdev http://tmsdev.dot.missouri/ ProxyPassReverse /tmsdev http://tmsdev.dot.missouri/ The initial url is http://tmsdev.dot.missouri/RealEstate/AAH/LitterPickup.aspx
I am getting 404 errors on everything that has /RealEstate/DXR.axd......... The DXR.axd is something from DEVEXPRESS here's the error I'm getting.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /RealEstate/DXR.axd was not found on this server.</p> <hr /> <address>IBM_HTTP_Server/6.0.2.35 Apache/2.0.47 (Win32) Server at ghweb04 Port 80</address> </body></html>
I have all my specify modules are loaded in pache like mod_rewrite in other face I have a script need require mod_rewrite in install steps but I have in testing : Apache Mod-Rewrite Unavailable
With this whole no-www thing going on. I've decided to have a look at whether I can do this for my domains.
Instead of writing a
RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC] RewriteRule ^(.*)$ h77p://domain.com/$1 [R=301,L]
for every single domain I'd like to do this for across all domains as standard. I'm not too hot on rewrite rules and have in the past avoided them cos of the complexities. But I'd like to get this done, and no silently do it, but reflect the URL difference in the webbrowsers address bar too.
On my website at www.jamescobban.net I have a directory which contains an ancient copy of my old static implementation of the site. It is there just in case someone has saved a old URL. However the data in that directory is several years out of date, so I would like to redirect the old static URLs to the equivalent dynamic URLs. For example: URLs.....
I wasn't warned that the <Directory> in the Apache conf file has to specify AllowOverride All whereas the default that is created when I install Ubuntu is AllowOverride None.I wasn't warned that I have to enable the mod_rewrite using a2enmod or else the rewrite commands are rejected.I am testing this on my private copy of the web-site where I can fiddle with options like that in the config file, but when I migrate this to my public server I do not have that privilege, so I want to try setting up the URL rewriting in .htaccess.
I would like to write a rewrite rule that does the following:
RewriteEngine On
Redirect 301 URL...
So what I want is that the first url is rewritten to go to the second ..I have a whole bunch of links that I have to redirect, so I would like to place them all into one .htaccess file or into the default configuration file of apache. So what I do not want is to create SomeFolder1 and someOtherFolder2 and to place a .htaccess file into that place in order to make it work. In fact I want to ignore the folders of the old link and only use the pagename.
I'm running Apache 2.4.4 Win32 on a Windows 2008 server. When trying to optimize a website I noticed a random reoccurring 2550ms delay in Time To First Byte. A file could have a TTFB of 200ms several times but suddenly it would get 2750ms. This could be a static file (image, html, js) or php. I've measured using ApacheBench (locally and remotely), webpagetest.org and bytecheck.com. After much trial and error I found the problem was with mod_rewrite. Disabling this and everything is fine.
I have setup a blank/new install with only basic config change (Listen, ServerRoot etc) to replicate result without anything else interfering. Following is the rewrite section I add to config.
Code: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule (^/Pictures.*) /$1 [L] </IfModule>
After Apache has started I execute "ab http://my.example.com/Pictures/Thumbnails/tmb_400X400_FFFFFF_660.jpg" and always get the delay. If I execute again it's normal. If I wait at least 30 seconds I get the delay. Following is a section from error.log with trace8 logging.
Code: [Tue Mar 12 23:28:56.123519 2013] [rewrite:trace3] [pid 7624:tid 888] mod_rewrite.c(468): [client 69.x.y.90:36279] 69.x.y.90 - - [my.example.com/sid#42c748][rid#26df0d0/initial] applying pattern '(^/Pictures.*)' to uri '/Pictures/Thumbnails/tmb_400X400_FFFFFF_660.jpg'
[Code] ....
As you see from line 3 to line 4 the time skips 2550ms. When the TTFB is normal then the log is identical except time doesn't change from line 3 to line 4. If I delete the rewrite section in config then TTFB is always normal, no matter what.
When I testet on the live server the time for fully loaded increase from 3800-4000ms to 8500-10500ms when mod_rewrite is enabled. And that is about 30 requests (php+css+js+images). So the impact is significant.
What can this be? I'm having a hard time believing it's a bug. Isn't mod_rewrite used a lot? I'm running Ubuntu (linux) at home, I'm going to install Apache there and see if I get the same result.
In my web site I have several index pages in different languages in the following format
[URL] ....
Two days ago I noticed increased, many times. Google bot activity on my site and when I checked my log file I found that all pages crawled were wrong web addresses: to the above index were added existing files from my site like
/folder1/folder2/file.html
So, the strings looked like
[URL] ....
And surprisingly all they returned code "200".
My question is: is there any way to rewrite such requests to the first ".html" found in the string.
I am trying to capture 3-4 digits when sent as part of a URL, for them to be proxied to another URL. I have no control over how the source sends this data, I am supposed to redirect it. Which works.
The problem is this works for all URLs that have digits to this server. I am expecting to trap URLs that send digits as part of the first call to the server, but this also affects URL calls that are part of other server call transactions, once digits appear, it gets redirected. What can I do to stop this interference?
I want to make it an internal rewrite though, not an external redirect. If I remove the [R=303] I still end up with a redirect (a 302). I assume mod_rewrite is forcing an external redirect because it's to a different [sub]domain.
Is there any way I can overcome this and make the change internal?
I am using apache with subversion and need to redirect a request for a file to a different file based on the user that has made the request. It appears that the URL for the requested file could be changed on the fly using RewriteMap; however, is there any way to get the User (as typically given in the request_rec available to apache hooks) making the request in the program used?
I am running a few different web servers on my home network and have found a way of binding each wb server (and any virtual hosts) to domain names and having a "central" web server rerouting a request to the appropriate server using reverse-proy. at the moment, this central web server is IIS (Windows Server 2008 R2) based and it works perfectly. I want to change the central server to an Apache based one.
As an example; I want the central server to see an incoming http request (e.g sub.domain.com) and reroute it using reverse-proxy to a different web server that wouldn't normaly be accessible from the Internet (e.g 192.168.1.122/index.html).
My question is how do you reverse-proxy to a different server on the LAN with mod_rewrite in Apache?
After a few years with apache 2.2 I decided to try apache 2.4 Both are running on windows 7. I had to recompile my modules against the new api, but that was succesful. I am now confronted that the rewrite rule for one of my locations :