Search Results

Search found 3190 results on 128 pages for 'isapi rewrite'.

Page 26/128 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • nginx: rewrite URL but have original URL stored in access.log as 200

    - by mhambra
    I'm setting up a link tracking system, which (temporarily) involves adding /link/id/ in front of URL (like http://server/data/id/publication/id/). rewrite data/id/(.*) http://server/$1; The request is logged as: ip - - [17/Nov/2011:10:07:19 +0300] "GET /data/id/publication/id.html HTTP/1.1" 302 154 "-" "UA"` For some reason (keeping the compatibility with AWStats) it is wanted to have 200 logged instead of 302. (nginx allows to get 301 code out of box with permanent option, but thats inappropriate too) What are my options here? Will the combination of location { } and rewrite do the job?

    Read the article

  • .htaccess URL rewrite to multi-parameter item

    - by MrCS
    I just spent the last 10 hours of my life on this & am running in circles, so was hoping someone may be able to help me. I want a specific URL to load like this: http://example.com/f/2011/image.png?attribute=small When a URL in a format such as this hits, I'd like to rewrite it to hit the server as: http://example.com/generate.php?f=2011/image.png&attribute=small Based on above, my question is two-fold: How can I rewrite the URL in htaccess to meet my requirements above? If the original URL didn't have the attribute query string parameter, how can I ensure attribute will be false/blank/etc when it hits the server via htaccess?

    Read the article

  • Rewrite 2 different directories with htaccess?

    - by jason
    I have a tricky problem (for me at least). I'm trying to rewrite / to a folder /webroot/www. I have some simple code and it works: RewriteRule ^$ /webroot/www/ [L] However at the same time if the URL starts with components, followed by anything else (ex. foo, as in /components/foo), and foo is an actual directory that exists inside components, I should rewrite to /components/foo/www instead. How can I achieve that? I can't seem to figure it out. I'm using Apache with .htaccess.

    Read the article

  • IIS NLB Web Farm to front Single Tomcat Instance

    - by Brent Pabst
    I've got a single Tomcat 6 server that hosts a JSP app. We just spun up a new IIS 7.5 web farm to host our other internal apps. Currently the machine that hosts Tomcat is also running IIS 7 with the ISAPI filter loaded to provide front-end handling for the JSP app. I'd like to move the IIS portion to the web farm to consolidate our IIS presence and let the Tomcat server just serve and run Java and Tomcat. Has anyone done this, is it even possible while ensuring session state is properly maintained? I had it up and running using the IIS Tomcat Connector http://tomcatiis.riaforge.org/ but after a while the communication between the boxes slowed and pages would not load. In addition it seemed like some of our authentication tickets were timing out. Thanks for any ideas or reference material!

    Read the article

  • App_offline.htm, CSS, images, and aspnet_isapi.dll

    - by LookitsPuck
    Hey all! So, the site I'm working on is using urlrewriting in coordination with aspnet_isapi.dll (everything is mapped to it). I put up my app_offline.htm file, and all the text shows, however, the CSS or images aren't being served. I'm guessing they're being processed by ASP.NET due to the wildcard mapping instead of IIS. Is this correct? If so, how can I allow IIS to serve these files? Furthermore, an issue I can see arising..in the web.config for the rewriter settings: <rewrite url="^~/images/network/(.*)/(.*).jpg$" to="~/services/ImageHandler.ashx?type=$1&amp;id=$2"/> <rewrite url="^~/image/view/(.*).jpg$" to="~/ServePRView.aspx?id=$1"/> <rewrite url="^~/asset/view/(.*).jpg$" to="~/services/ImageHandler.ashx?id=$1&amp;type=asset"/> Thanks for the help all, -Steve

    Read the article

  • Multi Svn Repositories in Apache

    - by fampinheiro
    I have a set up with apache and subversion In the apache configuration i have <Location /svn> DAV svn SVNParentPath c:/svn </Location> Now i have multiple repositories a a_b a_c a_b_c a_b_d b and i want to map them as a/svn a/b/svn a/c/svn a/b/c/svn a/b/d/svn b/svn to do this without adding directives and restarting apache i tought of making this rules RewriteEngine On RewriteCond $1 !=svn RewriteCond $2 !=svn RewriteRule ^/([^/]+)/(.*?)/svn/(.*)$ /$1_$2/svn/$3 [N] RewriteRule ^/([^/]+)/svn/(.*)$ /svn/$1/$2 [L,PT] this way i rewrite them to /svn/a /svn/a_b /svn/a_c /svn/a_b_c /svn/a_b_d /svn/b The objective is that the client don't have the notion of this happening when a acess is made to a folder without trailing slash the mod dav return a redirect to the folder with the trailing slash exposing my internal url. can i rewrite the outgoing url ?!

    Read the article

  • nginx folder redirect

    - by orbalon
    I'm trying redirect from an exact folder in nginx.conf Given the URL: domain.com/path1/path2/path3 Redirect to: sub.domain.com/path1/path2/path3 Here's what I have so far: location ~* ^/path1[\/?]$ { rewrite ^/(.*) http:sub.domain.com/$1 break; } I had it working with location /path1 { rewrite ^/(.*) http:sub.domain.com/$1 break; } The problem with that is it also redirects a page like domain.com/path1moretext/someotherpath to sub.domain.com/path1moretext/someotherpath Which is not what I want. (had to take out the "//" in the href code above because this is my first post, sorry).

    Read the article

  • Apache, modifying response codes from 404 to 301

    - by user72539
    Hi, I'm running a magento installation on an apache server. There are many pages indexed in both google and linked to from external sites. I can't use 301 redirects in a .htaccess file as I can't be sure I will catch all the links. At the moment all requests are rewritten through magento and if a request isn't found magento returns a 404 File not Found. Is there a way of using one of the apache modules to filter the response* from magento and if a 404 Not Found is being sent back then replace the response with a standard 301 Redirect to the home page? E.g. Request to Magento -- Apache -- Rewrite to Magento index.php page -- page processed. Response if request exists -- return results (200) if request doesn't exist -- return 404 -- apache filter change response -- return 301 redirect to / I appreciate any help. Thanks, Jon as far as I am aware mod_rewrite is only used to rewrite requests and doesn't allow the modification of responses.

    Read the article

  • Unidirectional synchronization and admin back-end

    - by HTF
    I have Wordpress installation on two web nodes (load balancing/failover). There is unidirectional synchronization from server A to server B so any updates must occur on the first web node. I have a problem with Wordpress admin side. I'm using Nginx and the initial plan was to create rewrite rule from domain.com/wp-admin to wpadmin.domain.com - pointing to the first node. The problem is that the Wordpress installation can be access only via main domain and without extra subdomain there is no distinction between both web servers for the rewrite rule. Could you please advise if there is any other solution in this case. Regards

    Read the article

  • mod_rewrite RewriteRule is not working

    - by buggy1985
    Hi, This is a follow-up of this question: Rewrite URL - how to get the hostname and the path? And a copy of this: mod_rewrite RewriteRule is not working I got this Rewrite Rule: RewriteEngine On RewriteRule ^(http://[-A-Za-z0-9+&@#/%=~_|!:,.;]*)/([-A-Za-z0-9+&@#/%=~_|!:,.;]*)\?([A-Za-z0-9+&@#/%=~_|!:,.;]*)$ http://http://www.xmldomain.com/bla/$2?$3&rtype=xslt&xsl=$1/$2.xsl it seems to be correct, and exactly what I need. But it doesn't work on my server. I get a 404 page not found error. mod_rewrite is enabled, as the following simple rule is working fine: RewriteEngine On RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L] Can you help? Thanks

    Read the article

  • RewriteRule applying pattern even though 1 of the RewriteCond's failed

    - by BHare
    #www. domain . tld RewriteCond %{HTTP_HOST} (?:.*\.)?([^.]+)\.(?:[^.]+)$ RewriteCond /home/%1/ -d RewriteRule ^(.+) %{HTTP_HOST}$1 RewriteRule (?:.*\.)?([^.]+)\.(?:[^.]+)/media/(.*)$ /home/$1/client/media/$2 [L] RewriteRule (?:.*\.)?([^.]+)\.(?:[^.]+)/(.*)$ /home/$1/www/$2 [L] Here is rewritelog output: #(4) RewriteCond: input='tfnoo.mydomain.org' pattern='(?:.*\.)?([^.]+)\.(?:[^.]+)$' [NC] => matched #(4) RewriteCond: input='/home/mydomain/' pattern='-d' => not-matched #(3) applying pattern '(?:.*\.)?([^.]+)\.(?:[^.]+)/media/(.*)$' to uri 'http://www.mydomain.org/files/images/logo.png' #(3) applying pattern '(?:.*\.)?([^.]+)\.(?:[^.]+)/(.*)$' to uri 'http://www.mydomain.org/files/images/logo.png' #(2) rewrite 'http://www.mydomain.org/files/images/logo.png' -> '/home/mydomain/www/logo.png' If you note on the 2nd 4 it failed the -d (if directory exists) pattern. Which is correct. mydomain does not have a /home/. Therefore it should never rewrite, atleast according to my understanding that all rewriterules are subject to rewriteconds as logical ANDs.

    Read the article

  • Nginx redirect one path to another

    - by SteveEdson
    I'm sure this has been asked before, but I can't find a solution that works. A website has switched CMS services, but has the same domain, how do I set up an nginx rewrite for a single page? E.g. Old Page http://sitedomain.co.uk/content/unique-page-name New page http://sitedomain.co.uk/new-name/unique-page-name Please note, I don't want everything within the content page to be redirected, but literally just the url mentioned above. I have about 9 redirects to set up, non of which fit in a pattern. Thanks! Edit: I found this solution, which seems to be working, except for the fact that it redirects without a slash: if ( $request_filename ~ content/unique-page-name/ ) { rewrite ^ http://sitedomain.co.uk/new-name/unique-page-name/? permanent; } But this redirects to: http://sitedomain.co.uknew-name/unique-page-name/

    Read the article

  • Lighttpd mod_rewrite conversion from .htaccess format

    - by hoball
    Hello, I am using lighttpd as webserver and is having an issue about mod_rewrite. Currently I have a set of Apache .htaccess rewrite rules from a PHP script: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ index.php [QSA,L] In my understanding, if the requested URI is not a file/directory/sym-link, append it to index.php eg. www.a.com/hello/world --> www.a.com/index.php/hello/world I attempted to convert to lighttpd specification: url.rewrite-if-not-file = ( "^(.*)$" = "index.php/$1" ) However, it doesn't work. I suspect that is due to misuse of $1. I tried to use $0/%0 or something else but they fail. Would you please provide me a hint on making the syntax work? Thank you!

    Read the article

  • htaccess rewriterule leading slash

    - by Tiddo
    I'm using htaccess to rewrite my urls so that I can have nice clean urls. However, the same htaccess file does different things on my local server and my remote server: On my local server the url to the website is like http://localhost/example/ and on my remote server the url is http://example.com/. For my local server I can use the following htaccess redirect rule: RewriteRule ^(.*)$ index.php?page=$1 [L,QSA] However, when I use this on my remote server I get an internal server error. Instead I have to use this: (note the leading slash) RewriteRule ^(.*)$ /index.php?page=$1 [L,QSA] Unfortunately this doesn't work on my local server: this rewrite rule requests http://localhost/index.php instead of http://localhost/example/index.php on my local server. How can I make this work on both my remote and local server?

    Read the article

  • ModRewrite Domain

    - by Mike Knoop
    I've done a little research into ModRewrite rules and conditions but have not been able to find a satisfactory set of rules/conds which achieve the effect I'm looking for. Essentially, I have a directory on domain A (http://www.domaina.com/dir/) which I would like to redirect to a different directory on domain B (http://www.domainb.com/diff_dir/). Note that I only want to apply the rewrite rule if the user is attempting to access /dir/ on domaina. If they are accessing a different directory or root I do not want to rewrite the URL. Thank you!

    Read the article

  • Blocking requests from specific IPs using IIS Rewrite module

    - by Thomas Levesque
    I'm trying to block a range of IP that is sending tons of spam to my blog. I can't use the solution described here because it's a shared hosting and I can't change anything to the server configuration. I only have access to a few options in Remote IIS. I see that the URL Rewrite module has an option to block requests, so I tried to use it. My rule is as follows in web.config: <rule name="BlockSpam" enabled="true" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{REMOTE_ADDR}" pattern="10\.0\.146\.23[0-9]" ignoreCase="false" /> </conditions> <action type="CustomResponse" statusCode="403" /> </rule> Unfortunately, if I put it at the end of the rewrite rules, it doesn't seem to block anything... and if I put it at the start of the list, it blocks everything! It looks like the condition isn't taken into account. In the UI, the stopProcessing option is not visible and is true by default. Changing it to false in web.config doesn't seem to have any effect. I'm not sure what to do now... any ideas?

    Read the article

  • Postfix rewrite sender: why doesn't this work

    - by Nick Coleman
    I have server A with an IP address only and a dummy FQDN (on the basis all machines should have a FQDN): pants.net.invalid. All mail is relayed through another server elsewhere, which works fine. On server A, Postfix rewrites the sender address with smtp_generic_maps = hash:/etc/postfix/generic. According to the Rewrite manual at http://www.postfix.org/ADDRESS_REWRITING_README.html#remote, this should rewrite all outgoing external mail's Sender address: $ cat /etc/postfix/generic @pants.net.invalid [email protected] but it does not. postmap -q [email protected] returns nothing. This works: [email protected] [email protected] It seems as though it is doing regex matching even though I specify type hash:. Clearly I am misunderstanding the manual. I don't want to use regex or pcre expressions because there are only a couple of users (root and two others) and I don't want the overhead. I can specify the users exactly and it works. But, I would like to know what I am misunderstanding for future reference. Thanks.

    Read the article

  • IIS 7 URL Rewrite to GeoServer running on Apache

    - by Maxim Zaslavsky
    I'm building a mapping application based on OpenLayers that uses GeoServer to serve up mapping data. The problem I'm having is that besides the map images I'm requesting through WMS, I'm using jQuery AJAX to get information from GeoServer. As GeoServer is running on a different port, my requests are being blocked due to cross-site scripting security policies in JavaScript. As a Java application, GeoServer runs on Apache on port 8080, while my IIS instance is running on port 80. Instead of building a proxy, I've decided to use URL Rewriting in IIS7 to fix this problem. I'm following this guide, but it's still not working. Here are my URL Rewrite rule settings: Matches URL: (.*) Condition: {HTTP_URL} matching /geoserver Action: rewrite to http://localhost:8080/{R:1}, appending query string When I request http://localhost/geoserver/wms?QUERY_LAYERS=SanDiego:FWSA_sandiego&LAYERS=SanDiego:FWSA_sandiego&SERVICE=WMS&VERSION=1.1.1&FEATURE_COUNT=20&REQUEST=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml&BBOX=-13009123.590156,3862057.2905992,-13006066.109025,3865114.7717302&INFO_FORMAT=text/html&x=20&y=20&width=40&height=40&srs=EPSG:900913, however, all I get is a 404, although the same request on port 8080 returns the proper result. What am I doing wrong? Thanks in advance.

    Read the article

  • Nginx rewrite for link shortener + Wordpress pretty URLs

    - by detusueno
    Okay so I installed Nginx/PHP/MySQL/Wordpress via a online walk through, and it had me enter these rewrites to enable Wordpress pretty URLs: if (-f $request_filename) { break; } if (-d $request_filename) { break; } rewrite ^(.+)$ /index.php?q=$1 last; error_page 404 = //index.php?q=$uri; This is then included in the vhost for my domain. What I'm trying to do now is add some redirection/link shortner rewrites that will play nice with the setup I have in mind. I'd like to redirect "x.com/y" to "x.com/script.php?id=y" for all external links that I post. The Wordpress link setup right now has almost all internal links begin with "news" (x.com/news/post-blah, x.com/news/category/1, etc) BUT I also have a few root links that point to some internal content (x.com/news, x.com/start). I'm guessing that's going to cause some conflicts. What's the best approach to do this? I've never worked with Nginx (or any rewrite rules) but maybe I can distinguish between "x.com/news" and "x.com/news/" to allow it to play nice? I had a friend setup a working version of this in Apache and it'd be nice if I could get this up on Nginx again.

    Read the article

  • Rewrite a url on Nginx

    - by Ido B
    I tried to use this - location / { root /path.to.app/; index index.php index.html; rewrite ^/(.*)$ /check_register.php?key=$1 break; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /path.to.app/$fastcgi_script_name; include fastcgi_params; } And its didn't work , This is my full config - user www-data www-data; worker_processes 4; events { worker_connections 3072; } http { include mime.types; default_type application/octet-stream; access_log off; sendfile on; tcp_nopush on; tcp_nodelay off; keepalive_timeout 15; gzip on; gzip_comp_level 3; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; server { listen 80; server_name localhost; location / { root html; index index.html index.htm; } location / { root /path.to.app/; index index.php index.html; rewrite ^/(.*)$ /check_register.php?key=$1 break; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /path.to.app/$fastcgi_script_name; include fastcgi_params; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } include /usr/local/nginx/sites-enabled/*; } How can i make it work?

    Read the article

  • Postback problem when using URL Rewrite and 404.aspx

    - by salle55
    I'm using URL rewrite on my site to get URLs like: http://mysite.com/users/john instead of http://mysite.com/index.aspx?user=john To achive this extensionless rewrite with IIS6 and no access to the hosting-server I use the "404-approach". When a request that the server can't find, the mapped 404-page is executed, since this is a aspx-page the rewrite can be performed (I can setup the 404-mapping using the controlpanel on the hosting-service). This is the code in Global.asax: protected void Application_BeginRequest(object sender, EventArgs e) { string url = HttpContext.Current.Request.Url.AbsolutePath; if (url.Contains("404.aspx")) { string[] urlInfo404 = Request.Url.Query.ToString().Split(';'); if (urlInfo404.Length > 1) { string requestURL = urlInfo404[1]; if (requestURL.Contains("/users/")) { HttpContext.Current.RewritePath("~/index.aspx?user=" + GetPageID(requestURL)); StoreRequestURL(requestURL); } else if (requestURL.Contains("/picture/")) { HttpContext.Current.RewritePath("~/showPicture.aspx?pictureID=" + GetPageID(requestURL)); StoreRequestURL(requestURL); } } } } private void StoreRequestURL(string url) { url = url.Replace("http://", ""); url = url.Substring(url.IndexOf("/")); HttpContext.Current.Items["VirtualUrl"] = url; } private string GetPageID(string requestURL) { int idx = requestURL.LastIndexOf("/"); string id = requestURL.Substring(idx + 1); id = id.Replace(".aspx", ""); //Only needed when testing without the 404-approach return id; } And in Page_Load on my masterpage I set the correct URL in the action-attribute on the form-tag. protected void Page_Load(object sender, EventArgs e) { string virtualURL = (string)HttpContext.Current.Items["VirtualUrl"]; if (!String.IsNullOrEmpty(virtualURL)) { form1.Action = virtualURL; } } The rewrite works fine but when I perform a postback on the page the postback isn't executed, can this be solved somehow? The problem seems to be with the 404-approach because when I try without it (and loses the extensionless-feature) the postback works. That is when I request: http://mysite.com/users/john.aspx Can this be solved or is there any other solution that fulfil my requirements (IIS6, no serveraccess/ISAPI-filter and extensionless).

    Read the article

  • Rewrite a URL that's already been redirected?

    - by Jack
    Hi guys, I'm running an Apache2 web server with a dynamic IP address. I bought exampledomain.net, and I use no-ip.com's domain-update service to redirect any visitors to my current ip address (endnote #1). For example, someone visits exampledomain.net and they get redirected to 73.181.57.34. It works like a charm. However, it isn't all that user-friendly. Can I rewrite the redirected, ip-address URL? I tried these rewrite rules in the root folder's .htaccess... RewriteEngine On RewriteCond %{HTTP_HOST} ^73\.181\.57\.34:88 RewriteRule ^(.*)$ http://www.exampledomain.net/$1 [L,NC] # I simplified the RewriteCond. I would use regex in a real situation. Of course, this creates an infinite loop. The user visits www.exampledomain.net. They're redirected to 73.181.57.34:88 by no-ip. Apache redirects them to www.exampledomain.net which redirects them back to 73.181.57.34:88... so on and so forth. I'm a noob when it comes to rewriting, but is there a way to rewrite a URL without redirecting? I tried these rewrite rules too (a shot in the dark)... RewriteEngine On RewriteCond %{HTTP_HOST} ^73\.181\.57\.34:88 RewriteRule ^(.*)$ my.exampledomain.net/$1 [L,NC] # I'd read that Apache replied with a redirect header when you include http Thanks! (1) No-IP works like this: You download and install their dynamic update client on your server. Every couple of minutes it polls your server for its current external ip address. If it's changed, it updates your server's ip address in no-ip's records.

    Read the article

  • IIS URL Rewrite rule - Default document for subdirectories

    - by Antonio Bakula
    I would like create URL rewrite rule that will set default document for my virtual folders. eg. someting like this www.domain.com/en/ -> www.domain.com/en/index.aspx www.domain.com/hr/ -> www.domain.com/hr/index.aspx www.domain.com/de/ -> www.domain.com/de/index.aspx directories en, hr, de doesn't really exists on web server they are just markers for languange used in site used by home grown http module that will rewrite path with query params. Quick solution was define rule for every single lang, something like this : <rewrite> <rewriteMaps> <rewriteMap name="Langs"> <add key="/en" value="/en/index.aspx" /> <add key="/hr" value="/hr/index.aspx" /> <add key="/de" value="/de/index.aspx" /> </rewriteMap> </rewriteMaps> <rules> But I would really like solution that would not require changes in web.config and adding rewrite rule for every languange used on particular site. Thanks !

    Read the article

  • Configure IIS to rewrite IP Address to Site Name

    - by Bath Man
    So i've started my first web site from home, and I'm trying to get it up and running and google crawlable and the like, but I can't seem to figure out how to have my site name returned in the address bar instead of my IP address. I've purchased a domain name for my site on Godaddy and then set it to redirect to my site. When you type in the domain name, you get redirected to http://0.0.0.0/default.aspx (not my real IP obviously), and that stays in the user's address bar. In order to fix that temporarily, I've set up masking on Go Daddy which keeps the URL in the address bar, but just shows my website in a frame. This is fine for users visiting the site, however any kind of automated robot such as GoogleBot cannot discover my content because of the frame. I've looked into ISAPI filters and server-site-rewriting, and the like... but I just can't quite figure out how to do what I need it to do. Any simple suggestions or links would be appreciated.

    Read the article

  • IIS7 Rewrite changing default button

    - by Skoder
    Hey, I've run into a strange problem regarding default buttons in master pages and IIS7 rewrite module. All my content pages have default buttons set in the code-behind (on prerender), or they are in panels on the aspx page. This works fine on my local machine and on the production server. However, when I enable IIS7 URL Rewrite, the default button is always to the one in the master page. protected void LoginButton_PreRender(object sender, EventArgs e) { Button btnDefault = sender as Button; this.Page.Form.DefaultButton = btnDefault.UniqueID; } That's how I set my default button in the code-behind. I'm not sure what the rewrite module could be doing. Thanks for any help

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >