Search Results

Search found 10546 results on 422 pages for 'apache commons'.

Page 201/422 | < Previous Page | 197 198 199 200 201 202 203 204 205 206 207 208  | Next Page >

  • RewriteCond simply doesn't work, doesn't check properly if file exists

    - by ultranol
    Hey everybody. I've been trying to solve this for hours now but came up with nothing. Inside .htaccess, whenever somebody requests an image from a folder of my website, I'm trying to check if a file with the same name exists in another folder; if it does, return that file; if it doesn't, return the file originally requested. It seems so easy but it simply doesn't work. The .htaccess code is as follows: RewriteEngine On RewriteCond /images/blog/watermark/$1 -f RewriteRule ^(.*) /images/blog/watermark/$1 The "RewriteCond" always returns negative, so the image requested is always loaded as is. If I change it to, like, RewriteCond %{REQUEST_FILENAME} -f it always returns positive, so it gets the image from the folder I want - except when the image's not there, generating an error, which is exactly what I'm trying to prevent. What am I doing wrong? Thanks.

    Read the article

  • SE friendly URLs appache code snippets

    - by Dan
    I want example.com/23-45 be transformed to example.com?id=23-45 Could you please post the code I should add to .htaccess file to make this work (Is this everything I should do to make this work - add a piece of code to .htaccess file ???) Thanks a lot!

    Read the article

  • .htaccess: RewriteCond syntax?

    - by Rosarch
    I'm using Drupal 6. Typically, when the user requests a URL for which Drupal has no response, it uses index.php as the error document. However, I'd like to suspend this behavior for a specific URL. How can I do this? RewriteCond %{REQUEST_FILENAME} !=fail RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] Where "fail" is the path I want to block. So www.example.com/fail should result in a 404. Incidentally, what does [L, QSA] do? I've looked at documentation without luck.

    Read the article

  • How do I do cron job for list of URLS

    - by mathew
    HI I do have a list of urls and my site is giving information about indexing and back links of any website out their. so what I want is I do have thousands of website lists with me and I want all that to run and store it in my database. so how do I do it using crone job?? the url address is for example www.mydomain.com/search?url=www.google.com so after google.com another one and all which is in the list.

    Read the article

  • How to only allow users to a page through a rewrite?

    - by Pietu1998
    I have a website where I am using SSI to include some stuff to the front page. However, I'd like to show users an URL that ends with .html. I have accomplished that via a .htaccess and mod_rewrite redirect. RewriteRule ^index\.html$ index.shtml [PT,L] Also, I am using another redirect pointing to this URL to internally load the pages' content with JavaScript (example.html to index.html#example.html) with a condition for not redirecting index.html. Now, I'd like to make the .shtml page 403 Forbidden. This is also easy: RewriteRule ^index\.shtml - [F] But, now index.html also gets forbidden. I have tried adding L to the .html-to-.shtml rule, but this doesn't help. How could this problem be solved?

    Read the article

  • Redirect Subdomain

    - by user2237615
    I am trying to redirect an old website that was on Godaddy's website builder and Quick Blogcast to a new site on Wordpress. I have no problems redirecting from the old page structure to the new one. For example: For example: http://sapientservicesllc.com/About_Us.html redirected to http://sapientservicesllc.com/about-us/ I used: 301 redirect /About_Us.html http://sapientservicesllc.com/about-us/ In the htaccess file. My problem is that I need to redirect all of the blog posts that were on a subdomain to the new wordpress site. For example: http://blog.sapientservicesllc.com/2011/10/14/risk-mitigation.aspx redirects to http://sapientservicesllc.com/risk-mitigation/ http://blog.sapientservicesllc.com/2012/10/04/could-cold-air-channeling-help-your-data-center.aspx redirects to http://sapientservicesllc.com/cold-air-channeling-help-data-center/ This: http://blog.sapientservicesllc.com/atom.aspx redirects to http://sapientservicesllc.com/?feed=atom This: http://blog.sapientservicesllc.com/2012/11.aspx redirects to http://sapientservicesllc.com/2012/11/ How can I set up the redirect to go to the new site? I have set the subdomain to forward to the actual domain in the Godaddy settings (blog.sapientservicesllc.com forwards to sapientservicesllc.com.

    Read the article

  • MOD_REWRITE HELP!

    - by shahinkian
    I want to use mode rewrite to display the following: mydomain.com/Florida/Tampa/ instead of mydomain.com/place.php?state=Florida&city=Tampa I've akready done this: (since I think it might make a difference!) mydomain.com/[name].html instead of mydomain.com/profile?user=[name] Here is the code! Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteBase / RewriteCond %{SCRIPT_FILENAME}! !-f RewriteCond %{SCRIPT_FILENAME}! !-d RewriteRule (.*).html profile.php?user=$1 [QSA.L]

    Read the article

  • Can I suppress or enforce URLs to be prefaced with http:// in ALL browsers?

    - by Ryan Dunlap
    I want to ensure that regardless of what browser a user is in, they all see the EXACT same characters in the URL bar. Most browsers show the preceding protocol type in the URL bar. However, Chrome for example truncates http:// (not sure about https) and starts with the domain name, ie: Chrome: stackoverflow.com/questions/ask Safari: http://stackoverflow.com/questions/ask So, is there a way to either suppress the http:// in all browsers, or even enforce it in all browsers? Preferably suppress.

    Read the article

  • How does this mod_rewrite code resolve properly?

    - by user532493
    My .htaccess file is as follows: Options -Multiviews RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.php It works, but I'm wondering how it works. For example, if I type in example.com/main, I get the file at www.example.com/main.php. How do I get the .php extension if the code tells the rewriting to stop after adding the www. to the beginning of example.com?

    Read the article

  • How to remove "index.php?" from HTACCESS [duplicate]

    - by Francis Goris
    This question already has an answer here: Reference: mod_rewrite, URL rewriting and “pretty links” explained 2 answers I have url like this: www.site.com/index.php?/genero/aventura/av/ But I would like this to be my new url: site.com/genero/aventura/av/ I used the following code: <IfModule mod_rewrite.c>RewriteEngine On RewriteCond %{HTTP_HOST} !^www.site.com/$ [NC] RewriteRule ^index.php\?/(.*)$ site.com/$1 [R=301,L] </IfModule> but only returns me: site.com/index.php?/genero/aventura/av/ This is my latest & full version: RewriteEngine on #RewriteCond $1 !^(index\.php|ver_capitulo\.html|google3436eb8eea8b8d6e\.html|BingSiteAuth\.xml |portadas|public|mp3|css|favicon\.ico|js|plantilla|i|swf|plugins|player\.swf|robots\.txt) RewriteCond $1 !^(index\.php|public|css|js|i|feed|portadas|robots\.txt|BingSiteAuth\.xml|plugins|i|mp3|favicon\.ico|pluginslist\.xml|google3436eb8eea8b8d6e\.html) RewriteRule ^(.*)$ /index.php?/$1 [L] #DirectoryIndex index.php #RewriteCond %{THE_REQUEST} http://www.page.com/index\.php [NC] #RewriteRule ^(.*?)index\.php$ http://page.com/$1 [L,R=301,NC,NE] #DirectoryIndex index.php #RewriteEngine On Thanks for reading.

    Read the article

  • mod_rewrite per-dir redirection returning a 400

    - by Eaterrust
    I moved my images directory to a different folder, and now I want to redirect all images requests from that folder to the new one. I do not have access to the main configuraion file, so I'm doing this in a .htaccess. I tried this, and it works:     RewriteCond %{REQUEST_URI} old_dir/.+.(jpg|png|gif)$     RewriteRule old_dir/(.+[^/]+..+)$ $1 [L,PT] But since they have permanently moved, I want to do a proper redirect, so I added the [R] flag, like this:      %{REQUEST_URI} old_dir/.+.(jpg|png|gif)$     RewriteRule old_dir/(.+[^/]+..+)$ $1 [L,PT,R] But the server gets confused, and returns a 400, so I looked at the log file, and this is what happens:     strip per-dir prefix: C:/wamp/www/natrazyle/old_dir/images/banner.jpg - old_dir/images/banner.jpg     applying pattern 'old_dir/(.+[^/]+..+)$' to uri 'old_dir/images/banner.jpg'     rewrite 'old_dir/images/banner.jpg' - 'images/banner.jpg'     add per-dir prefix: images/banner.jpg - C:/wamp/www/natrazyle/images/banner.jpg     explicitly forcing redirect with http://localhost/C:/wamp/www/natrazyle/images/banner.jpg As you can see, the full local path gets added after localhost I know I'm doing something wrong, I just can't figure it out myself. Any help would be greatly appreciated...

    Read the article

  • How can I limit user bandwidth usage?

    - by Scarface
    Ok, I have a site, and it serves all images and mp3s through a php script and can be controlled and limited, but I am now worried about overall bandwidth of my site. For example, what if someone just sends a million requests to one of my pages? Does anyone have any suggestions into server methods used to prevent this? Should I use mod_cband http://www.howtoforge.com/mod_cband_apache2_bandwidth_quota_throttling_p2?

    Read the article

  • why this httaccess code results into a redirect loop?

    - by user3606997
    Here I am stuck with my htaccess code. I have been trying to figure it out for the last 11 hours why am I getting a redirect loop for the below code. Options -Indexes +FollowSymLinks RewriteEngine on #Check for no www or www RewriteCond %{HTTP_HOST} ^dummysite.com$ [or] RewriteCond %{HTTP_HOST} ^www.dummysite.com$ [NC] RewriteRule . - [E=FIRSTPART:true] # IE 6 RewriteCond %{HTTP_USER_AGENT} !MSIE\s6 RewriteCond %{ENV:FIRSTPART} true RewriteRule ^(.*)$ https://www.dummysite.com/$1 [R=302,L] Why the above code results into a redirect loop? EDIT: What I actually want is that if the user is from IE6 then he should be redirected to http version with www as prefix no matter if he types www or not in the url. And on the other hand if the user is from any other browsers then he should be redirected to a https version with www as prefix no matter if he types www in the url or not.

    Read the article

  • Using mod_negotiation to serve webp if the UA requests it.

    - by Rich Bradshaw
    Is it possible to use mod_negotiation to serve up a webp image if the browser supports it, and a jpg otherwise? For instance, if I link to an image with the path /images/test, it serves the image found at /images/test.webp if the UA knows about webp, or jpg otherwise? I've tried poking around, but it seems that the Accept headers in Chrome at least look like Accept:*/*, rather than specifying the image type. If this isn't the way to do it, has anyone got any other suggestions?

    Read the article

  • Using Mod_Rewrite in HTTPD.CONF file

    - by Mike Lovely
    I want to rewrite URLs so when a user goes to; http://www.example.com/applications/newWeb/www/index.php?page=48&thiscontent=2660&date=2013-10-11&pubType=0&PublishTime=09:30:00&from=home&tabOption=1 and if the URL contains thiscontent=2660 (which in this example above, it does) I want to redirect them to; http://www.example.come/index.php/publications/finance-and-economics/departmental-resources I have about 30 different thiscontent=XXXX types and imagine I’ll have to copy and edit this rule 30 different times for any links to my old website still knocking around out there. I have access to my httpd.conf file but have never done a mod_rewrite before. I also don't really need these showing up in the error logs as 301s. Will that happen? Because at the moment there are hundreds!

    Read the article

  • TV Guide script - getting current date programmes to show

    - by whitstone86
    This is part of my TV guide script: //Connect to the database mysql_connect("localhost","root","PASSWORD"); //Select DB mysql_select_db("mytvguide"); //Select only results for today and future $result = mysql_query("SELECT programme, channel, episode, airdate, expiration, setreminder FROM mediumonair where airdate >= now()"); The episodes show up, so there are no issues there. However, it's getting the database to find data that's the issue. If I add a record for a programme that airs today this should show: Medium showing on TV4 8:30pm "Episode" Set Reminder Medium showing on TV4 May 18th - 6:25pm "Episode 2" Set Reminder Medium showing on TV4 May 18th - 10:25pm "Episode 3" Set Reminder Medium showing on TV4 May 19th - 7:30pm "Episode 3" Set Reminder Medium showing on TV4 May 20th - 1:25am "Episode 3" Set Reminder Medium showing on TV4 May 20th - 6:25pm "Episode 4" Set Reminder but this shows instead: Medium showing on TV4 May 18th - 6:25pm "Episode 2" Set Reminder Medium showing on TV4 May 18th - 10:25pm "Episode 3" Set Reminder Medium showing on TV4 May 19th - 7:30pm "Episode 3" Set Reminder Medium showing on TV4 May 20th - 1:25am "Episode 3" Set Reminder Medium showing on TV4 May 20th - 6:25pm "Episode 4" Set Reminder I almost have the SQL working; just not sure what the right code is here, to avoid the second mistake showing - as the record (which indicates a show currently airing) does not seem to work at present. Please can anyone help me with this? Thanks

    Read the article

  • Can anyone tell me whats wrong with this htaccess code

    - by mathew
    I am not able to get through with this code...I need to capture the request but with this code I am able to redirect but it cannot find the particular search page. RewriteCond %{THE_REQUEST} ^[A-Z]+\ /searcha\.php\?name=(www\.)?([^/\ ]+)[^\ ]*\ HTTP/ RewriteRule ^.*$ http://www.mydomain.com/%2? [R=301,L] can any one tell me what is I am missing??

    Read the article

  • Strange mod_rewrite problem; Website works partially

    - by Camran
    I have Ubuntu 9.10 Server... I need to get mod_rewrite working... the mod_rewrite module IS LOADED. On my server, the httpd.conf is empty, instead everything (almost) is in a file called apache2.conf. Anyways, I have also read I have to change the AllowOverride None to AllowOverride All in some file... My httpd.conf is empty as you know, but I have a folder called sites-enabled which contains a 000-default file. This is where I have set: AllowOverride All Now my goal as I stated in the last Q is to turn this link: http://mydomain.com/ad.php?ad_id=Bmw_nice_M3_497379462 into this: http://mydomain.com/Bmw_nice_M3_497379462 So as I got an answer in the last Q i inserted this into the htaccess file: Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteCond %{REQUEST_URI} !^/ad\.php RewriteRule ^(.*)$ ad.php?ad_id=$1 [L] Now, this works (no fully) when entering the url manually in the adress bar, but my website isn't working now for some reason. It is like the website is locked down or something, and unless I change AllowOverride to None it will act like that. Any ideas why? Also another note, the links inside the rewritten url doesn't work properly (images are not shown, while some are shown)...

    Read the article

  • Automatic backup

    - by xRobot
    I need to backup automatically daily my database in mysql and all image files on the server. Is there a way to backup these things and send it on my email address ?

    Read the article

  • Is It possible to change dynamically delay on a Scheduled Poller in Camel via JMX?

    - by sebbrousse
    I would like to set/change the delay of a File consumer at runtime through JMX. I am able to change the value of the property but it doesn't seem to be taken into account until I restart the consumer. Example with the camel-archetype-java and its basic file example: Run It Change the delay of the File Consumer by calling the setDelay Operation with the JConsole Delay property of the Consumer is changed but logs show it continues to poll at 500ms by default Stop/Start the consumer New value of delay is used by the consumer Do I need anothers steps or active any configuration to make it work at runtime?

    Read the article

  • mod_rewrite: check if isn't a certain domain

    - by weingage
    I'm migrating some code from a working web app, but can't get it to work on the new server. Everything seems to be configured correctly, but I'm getting internal redirect limit errors in Apache2. Here are my rewrites and explanation This WORKS - any subdomains that aren't cdn. or manage. should be redirected to u.php RewriteCond %{HTTP_HOST} ^(^.*)\.mediasprk\.com$ [NC] RewriteCond ^(.*)$ !^(cdn|manage)$ RewriteCond %{REQUEST_URI} !\.(png|gif|jpg)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ u.php?uri=$1&hostName=%{HTTP_HOST} This is no longer working. Goal here is to handle CName pointing. So if it's not my app domain (mediasprk.com), then handle it by sending it to u.php. RewriteCond %{HTTP_HOST} !^mediasprk\.com$ [NC] RewriteCond %{REQUEST_URI) !\.(png|gif|jpg)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ u.php?uri=$1&hostName=%{HTTP_HOST} Can anyone see the issue here in the second block that would cause the redirect limit errors? Maybe something wrong in the rewrites? Thanks.

    Read the article

  • Placing .htaccess file in var/www folder messes my website up...

    - by Camran
    I am playing with mod_rewrite now, and have successfully enabled it. However, I need to put a htaccess file inside var/www/ in order to achieve what I want, which is to rename Urls simply... When I place it my website becomes very strange and nothing basically works... Is there any code I need to put into the htaccess file in order for things to act normally? Here is the htaccess file I have so far: Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteCond %{REQUEST_URI} !^/ad\.php RewriteRule ^(.*)$ ad.php?ad_id=$1 [L] My DocumentRoot is also set to var/www/ and my entire website root is there... (index.html etc etc)... What am I missing about the htaccess? If you need more input let me know...

    Read the article

  • Broken php/localhost/something

    - by ghego1
    I was trying to install the mcrypt libraries following this tutorial (http://www.glenscott.co.uk/blog/2011/08/29/install-mcrypt-php-extension-on-mac-os-x-lion/), but something must have gone wrong and now when I load a php page on my localhost I see this: query="SELECT DISTINCT ".$field." as a,".$field2." as b FROM ".$tab." ".$where. " Group by ".$field." order By ".$orderBy; return $this->query; } And all the remaining code of the php page that should get loaded. I've retrieved the previous versions of the private/etc folder and usr/lib/php folder with time machine but it didn't help. And now if I execute sudo pachectl restart it gives me this error: sudo: no valid sudoers sources found, quitting (while before it worked. PS I'm on a mac with Mountain Lion

    Read the article

< Previous Page | 197 198 199 200 201 202 203 204 205 206 207 208  | Next Page >