Search Results

Search found 2277 results on 92 pages for 'mod rpaf'.

Page 60/92 | < Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >

  • mod_rewrite: remove trailing slash (only one!)

    - by tshabalala
    Hello. I use mod_rewrite/.htaccess for pretty URLs. I'm using this condition/rule to eliminate trailing slashes (or rather: rewrite to the non-trailing-slash-URL, by a 301 redirect; I'm doing this to avoid duplicate content and because I like URLs with no trailing slashes better): RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{HTTP_HOST} !^\.localhost$ [NC] RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L] Working well so far. Only drawback: it also forwards "multiple-trailing-slash"-URLs to non-trailing-slash-URLs. Example: http://example.tld/foo/bar////// forwards to http://example.tld/foo/bar while I only want http://example.tld/foo/bar/ to forward to http://example.tld/foo/bar. So, is it possible to only eliminate trailing slashes if it's actually just one trailing slash? Sorry if this is a somewhat annoying or weird question! Thanks.

    Read the article

  • Is there a way that I can force mod_perl to re-use buffer memory?

    - by Pavel Georgiev
    Hi, I have a Perl script running in mod_perl that needs to write a large amount of data to the client, possibly over a long period. The behavior that I observe is that once I print and flush something, the buffer memory is not reclaimed even though I rflush (I know this can't be reclaimed back by the OS). Is that how mod_perl operates and is there a way that I can force it to periodically free the buffer memory, so that I can use that for new buffers instead of taking more from the OS?

    Read the article

  • Linking Apache to Tomcat with multiple domains.

    - by Royce Thigpen
    Okay, so I've been working for a while on this, and have been searching, but so far I have not found any answers that actually answer what I want to know. I'm a little bit at the end of my rope with this one, but I'm hoping I can figure this out sometime soon. So I have Apache 2 installed and serving up standard webpages, but I also have that linked to a Tomcat instance for one of my domains currently supported. However, I want to add another domain to the server via Apache that points to a separate code base from the one I already have. I have been coming at this from several different angles, and I have determined that I just don't know enough about setting up these servers to really do what I want to do. Little information on my server: Currently running a single Tomcat5.5 instance with Apache 2, using mod_jk to connect them together. I have a worker in workers.properties that points it's "host" field to "localhost" with the correct port my Tomcat instance, so that all works. In my Tomcat server.xml file, I have a host defined as "localhost" that points at my webapp that I am currently serving up, with that host set as the defaultHost as well. One thought I had was that I could add a new worker with a different host than "localhost" (i.e. host2) and then define a new host in my server.xml file called "host2" to match it, but after reading around some on the internet, It seems the "host" of the worker must point to a server, and not a hostname in the Tomcat instance, is this correct? Again, a simple rundown of what I want: Setup in apache/tomcat combo such that www.domain1.com points at "webapp1" and www.domain2.com points at "webapp2".

    Read the article

  • Mod_Rewrite: Insert "/" between variables and values in URL

    - by Abs
    Hello all, I am attempting clean useful URLs using mod_rewrite. I am sure this is a common question but I am not so hot with mod_rewrite: I have this URL: http://mysite.com/user.php?user=fatcatmat&sort=popularv I want to be able to rewrite it like this: http://mysite.com/user/user/fatcatmat/sort/popularv (Is there a way to remove duplicates in a URL?) I think I have managed to do the removal of the PHP extension. RewriteRule ^(.*)\$ $1.php [nc] Is the above correct? For the separate pages, I would have something like this. RewriteRule ^/?user(/)?$ user.php Main Question: Its a bit tedious to do all the above but is there a MEGA rewrite rule that will just place "/" in between variables and their values and remove the .php extension from all pages? Thank you for any help.

    Read the article

  • Problem with mod_rewrite rules in .htaccess file

    - by Prashant
    This is my .htaccess file but it is not working. Not any URL is redirected. Help me. RewriteEngine on RewriteRule ^home index.php RewriteRule ^contactus index.php?file=c-contactus RewriteRule ^course_registration index.php?file=c-course_registration RewriteRule ^ncplhpage index.php?file=c-ncplhpage RewriteRule ^scplhpage index.php?file=c-scplhpage RewriteRule ^corporatetra index.php?file=c-corporatetra

    Read the article

  • How to emulate mod_rewrite in PHP

    - by Tyler Crompton
    I have a few URLs that I want to map to certain files via PHP. Currently, I am just using mod_rewrite in Apache. However, my application is getting too large for the rewriting to be done with regular expressions. So I created a file router.php that does the rewriting. I understand to do a redirect I could just send the Location: header. However, I don't always want to do a redirect. For example, I may want /api/item/ to map to the file /herp/derp.php relative to the document root. I need to preserve the HTTP method as well. "No problem," I thought. I made my .htaccess have the following snippet. RewriteEngine On RewriteRule ^api/item/$ /cgi-bin/router.php [L] And my router.php file looks as follows: <?php $uri = parse_url($_SERVER['REQUEST_URI']); $query = isset($uri['query']) ? $uri['query'] ? array(); // some code that modifies the query require_once "{$_SERVER['DOCUMENT_ROOT']}/herp/derp.php?" . http_build_query($query); ?> However, this doesn't work, because the OS is looking for a file named derp.php?some=query. How can I simulate a rewrite rule such as RewriteRule ^api/item/$ /herp/derp/ [L] in PHP. In other words, how do I tell the server to process a different URL than requested and preserve the query and HTTP method without causing a redirect? Note: Using variables set in router.php is less than desirable and is bad structure since it's only supposed to be responsible for handling URLs. I am open to using a light-weight third party solution.

    Read the article

  • Rewrite URL to index.php but avoid index.php in the URL

    - by Tom
    I'm trying to internally redirect all requests to index.php and externally redirect all requests that contain index.php using a .htaccess file. So URLs like http://host/test should be processed by index.php and URLs like http://host/index.php/test should be redirected to http://host/test and then processed by index.php (without redirecting the browser to index.php) I tried the following but always get a message "Too many redirects...": RewriteRule ^index\.php/?(.*)$ /$1 [R,L] RewriteRule .* index.php/$0 [L]

    Read the article

  • how to get apache mod_cache work with mod_wsgi (django)?

    - by harmv
    I thought i'd speed up my django projects, by letting apache doing some caching for me. Unfortunately I see that apache never caches my dynamic pages. Has mod_cache problems with mod_wsgi served code ? My apache config: <VirtualHost *:80 ServerName myserver.com CacheEnable mem / # for testing only CacheIgnoreQueryString On CacheIgnoreCacheControl On WSGIDaemonProcess aname processes=1 threads=25 WSGIProcessGroup aname Alias /media/ /home/harm/projects/test/media/ WSGIScriptAlias / /home/harm/projects/test/wsgi.py The response does have the correct caching headers: Content-Length 2647 Content-Encoding gzip Vary Accept-Encoding Cache-Control public, max-age=3600 Keep-Alive timeout=15, max=100 Connection Keep-Alive Content-Type application/x-javascript Am I missing something ?

    Read the article

  • mod_rewrite help can't get it to work

    - by Maenny
    Hi Folks, This is the first time I use mod_rewrite and I can't get it to work. I have a website with bands and their IDs. What I want: a URL /bands/My_Band_id13/ should redirect to /bands/index.php?bandname=My_Band&bandID=13 What I have: RewriteRule ^/bands/(.*)_id(.*)/$ /bands/index.php?bandname=$1&bandID=$2 What am I doing wrong? THx, Maenny

    Read the article

  • htaccess redirect to subfolder with same path attached?

    - by Josh
    How can I go about redirecting my old URLs which would have been: http:// blah.com/some/post/name to the new URLs which would be: http:// blah.com/new/some/post/name Is this even possible? I don't want to simply redirect any requests for the blah.com domain to blah.com/new I want to make sure the subpath is still attached to the redirect

    Read the article

  • Apache mod_rewrite - forward domain root to subdirectory

    - by DuFace
    I have what I originally assumed to be a simple problem. I am using shared hosting for my website (so I don't have access to the Apache configuration) and have only been given a single folder to store all my content in. This is all well and good but it means that all my subdomains must have their virtual document root's inside public_html, meaning they effectively become a folder on my main domain. What I'd like to do is organise my public_html something like this: public_html/ www/ index.php ... sub1/ index.php ... some_library/ ... This way, all my web content is still in public_html but only a small fraction of it will be served to the client. I can easily achieve this for all the subdomains, but it's the primary domain that I'm having issues with. I created a .htaccess file in public_html with the following: Options +SymLinksIfOwnerMatch # I'm not allowed to use FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^/www [NC] RewriteRule ^(.*)$ /www/$1 [L] This works fairly well, but for some strange reason www.example.com/stuff is translated into a request for www.example.com/www/stuff and hence a 404 error is given. It was my understanding that unless an 'R' flag was specified, mod_rewrite was purely internal so I can't understand why the request is generated as that implies (to me at least) redirection. I assumed this would be a trivial problem to solve as all I actually want to do is forward all requests for the root of www.example.com to a subdirectory, but I've spent hours searching for answers and none are quite correct. I find it difficult to believe I'm the only person to have this issue. I apologise if this question has been answered on here before, I did search and trawl but couldn't find an appropriate answer. Please could someone shed some light on this?

    Read the article

  • Apache mod_rewrite rules problems

    - by ni
    domain.com/index/ to domain.com/index.php domain.com/index/hello to domain.com/index.php/hello The site is use path_info,and the default rule not works: RewriteRule ^([^/]+)/(.*)$ $1.php/$2 [L] I change to: RewriteRule ^([^/.]+)((/[^/]+)*)/?$ $1.php$2 [L] That was strange domain.com/index/ to domain.com/index.php works fine domain.com/index/hello to domain.com/index.php/hello not work and it says No input file specified. Php is run in fast cgi mode in apache

    Read the article

  • having trouble with a mod_rewrite rule

    - by Jeff
    want to rewrite urls like site.com/software to wp-content/themes/dir/software.php and something is not working.. Here's what I have: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] RewriteRule ^software wp-content/themes/dir/software.php [L] Thanks!

    Read the article

  • Redirect to Apache default 404 page with mod_rewrite?

    - by Pekka
    Is there a way to actively serve Apache's default 404 page for a number of URLs using mod_rewrite? Not a custom error document, but a rule like RewriteCond %{REQUEST_URI} ^/dirname/pagename RewriteRule -- serve 404 page ----- I guess I could build a PHP page that sends the 404 header and have mod_rewrite redirect all the URLs there but I would prefer a solution that is based on mod_rewrite only. I just had the idea of redirecting to a non-existent address: RewriteCond %{REQUEST_URI} ^/dirname/pagename RewriteRule .* /sflkadsölfkasdfölkasdflökasdf but that would give the user the message "/sflkadsölfkasdfölkasdflökasdf does not exist" on the error page, which looks a bit unprofessional.

    Read the article

  • .htaccess for displaying the .html files

    - by user310850
    I have three files in a folder 'test' one.php two.php print.html And i have .htaccess file in the same folder RewriteEngine On RewriteBase /test/ RewriteRule ^(.+)\.html$ $1\.php [L] if we take the print.html in browser , there will be error , because of .htaccess file, for there is no 'print.php' page How can we solve it , by modifing the .htaccess file. So that while taking the print.html, it should display in the browser

    Read the article

  • Using - Instead of + in WordPress Search Permalink

    - by poer
    Options +FollowSymLinks RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]+ /(#[^?& ]*)??([^& ]*&)?s=([^& ]+)[^ ]* HTTP/ RewriteRule ^$ http://wordpressblog.com/search/%3? [R=301,L] Currently I use the above .htaccess mod_rewrite rule to convert default WordPress search permalink: http://wordpressblog.com/?s=key+word into nice permalink like this: http://wordpressblog.com/search/key+word My question is: What part of the mod_rewrite rule above that I need to change to get a nicer permalink like this one: http://wordpressblog.com/search/key-word.html Thanks.

    Read the article

  • how do i use htaccess to make http requests work properly

    - by Gabriel
    I currently have css and javascript file calls (amongst other things) like the following: href="/css/default.css" src="/js/ui_control.js" putting the preceding / in to make the files relative to the root. This works great when my page is in the root of the domain. However, I'm currently in the middle of transferring my site to a new hosting provider and as such have a temporary URL which is: HOST-IP/~username As such, all file calls are trying to be called from HOST-IP/css/default.css etc instead of within the ~username sub-folder. Of course I can wait until the domain name servers propagate but that's beside the point. How would I go about writing a rule in the .htaccess file that would redirect all file calls that start with a /, from going to HOST-IP/FILE-CALL, and instead to go to HOST-IP/~USERNAME/FILE-CALL. ? Any ideas?

    Read the article

  • Pointing a domain to a subscription based web-app?

    - by jefff
    Hello everyone, I'm about to start building a subscription based website that will function much like 37signals offerings in terms of users paying a monthly fee to use the site. But in my case I would like for them to be able to use their own hosted domain names and have them point to my server. Is this possible? How do i link up the domain name with their account on my server? Thanks a mil!

    Read the article

  • Problems with mod_rewrite and 301 redirects from one dynamic url to another

    - by user349891
    Hey all, I'm having all kinds of problems with a bunch of apache redirects just now and could really use some help! I'm wating to put in a 301 redirect for a load of urls from a client's old site to their new site in the following format; Old - page.php?pageNum_rs_all=0&totalRows_rs_all=112 New - page/sub?foo=bar The values in the query sting for the old site don't in any way tie up to any ids or references on the new site, I only want to match that specific request and redirect to the new page. It feels like I've tried just about every combination of rewriterule I can find online but still nothing seems to be working. This is running on Apache 2.2. The rule I started with (and keep going back to) is; RewriteRule ^/page.php\?pageNum_rs_all=0&totalRows_rs_all=112 /page/sub?foo=bar [R=301,L,NE] Any help would be greatly appreciated! c.

    Read the article

  • mod_rewrite browser trying to get content from non-existant dir

    - by humgl
    I have my mod_rewrite set up so that it redirects all requests that aren't targeting existing files or directories to index.php?req=* where * is the request. Works all fine but when I send the browser to something like this: http://myurl/A/B/C The browser tries to find all images, stylesheets in the non-existing folder C. How can I make the browser to look in / instead of the 'virtual' directory? Do I have to put an absolute path everywhere?

    Read the article

  • Wicket application + Apache + mod_jk - AJP queues are filling up!

    - by nojyarg
    Dear community, We are having a Wicket-based Java application deployed in a production server cluster using Apache (2.2.3) with mod_jk (1.2.30) as load balancing component w/ sticky session and Jboss 5 as application container for the Java application. We are inconsistently seeing an issue in our production environment where our AJP queues between Apache and Jboss as shown in the JMX console fill up with requests to the point where the application server is no longer taking on any new requests. When looking at all involved system components (overall traffic, load db, process list db, load of all clustered application server nodes) nothing points towards a capacity issue which would explain why the calls are being stalled in the AJP queue. Instead all systems appear sufficiently idle. So far, our only remedy to this issue is to restart the appservers and the load balancer which only occasionally clears the AJP queues. We are trying to figure out why the queues are filling up to the point that no calls get returned to the end user although the system is not under a high load. Has anyone else experienced similar problems? Are there any other system metrics we should monitor that could explain the queuing behavior? Is this potentially a mod_jk issue? If so, is it advisable to swap mod_jk with mod_cluster to resolve the issue? Any advice is highly appreciated. If I can provide additional information for the sake of troubleshooting I would be more than willing to do so. /Ben

    Read the article

  • Unexpected htaccess behaviour (mod_rewrite and apache)

    - by avastreg
    Yeah, mod_rewrite is driving me crazy. Here is the problem: my htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [L,QSA] when i try to access the page advantix (so address was www.mywebsite.com/advantix), i'm being redirected to advantix/?url=advantix Looking at the access log, i have a suspicious 301 in the middle "GET /advantix HTTP/1.1" 301 335 "-" "Mozilla/5.0" "GET /advantix/?url=advantix HTTP/1.1" 200 186 "-" "Mozilla/5.0" There is one important detail: advantix is a directory. So, if i comment that rule, advantix goes to the folder and list the files. Why it applies automatically the / if there's a folder matching? I don't want to reach the folder, i want to reach index.php?url=advantix with a call to advantix. I have the rewriteLogs too, but they didn't help more. My vhost conf has Directory tag with Options All, if helps, i don't know much about that.

    Read the article

  • How to redirect Sub domain as attribute in page with .htaccess

    - by rkaartikeyan
    I want like this Ex: http://user1.mysite.com or http://user2.mysite.com if anyone enter URL Like these on browsers it should go as bellow http://mysite.com/user.php?userName=user1 How can i solve this with .htaccess With help of Prix i solved this Issue RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.mysite\.com [NC] RewriteCond %{HTTP_HOST} ^(.*)\.mysite\.com RewriteRule ^(.*)$ http://mysite.com/user.php?userName=%1 [R=301] Its working fine :) http://user1.mysite.com http://mysite.com/user.php?userName=user1 -> This one is working fine with Prix Code Now i want Like Bellow. I have tried lot but not working. So again i don't have anyway rather than ask here. I want like this http://user1.mysite.com/inbox/ http://mysite.com/inbox.php?userName=user1 And also Like this http://user1.mysite.com/message/1 http://mysite.com/view-message.php?userName=user1&messageID=1

    Read the article

  • Simple problem with mod_rewrite in the Fat Free Framework

    - by ian
    I am trying to setup and learn the Fat Free Framework for PHP. http://fatfree.sourceforge.net/ It's is fairly simple to setup and I am running it on my machine using MAMP. I was able to get the 'hello world' example running just fin: require_once 'path/to/F3.php'; F3::route('GET /','home'); function home() { echo 'Hello, world!'; } F3::run(); But when I try to add in the second part, which has two routes: require_once 'F3/F3.php'; F3::route('GET /','home'); function home() { echo 'Hello, world!'; } F3::route('GET /about','about'); function about() { echo 'About Us.'; } F3::run(); I get a 404 error if I try the second URL: /about Not sure why one of the mod_rewrite commands would be working and not the other. Below is my .htaccess file: # Enable rewrite engine and route requests to framework RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L,QSA] # Disable ETags Header Unset ETag FileETag none # Default expires header if none specified (stay in browser cache for 7 days) <IfModule mod_expires.c> ExpiresActive On ExpiresDefault A604800 </IfModule>

    Read the article

< Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >