FAQ Database Discussion Community


How to create a private certificate for connecting to a website

apache,ssl,privatekey,digital-certificate,self-signed
My apologies if this is a duplicate, I may just not be using the correct terminology in my queries to find what I am looking for. I have a vendor that sent me a certificate to install in my browser so that we can access their website. We cannot get...

Virtual host returns the default host on another pc

apache
Hello I am trying to set up an apache server on a PC.(PC A) I created the folder /var/www/test. In this folder I have my index.html. I created a conf file test.conf in the /etc/apache2/sites-available folder with the following entries: <VirtualHost www.test.tld:80> ServerName www.test.tld DocumentRoot /var/www/test ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log...

Exporting Data from Cassandra to CSV file

apache,csv,cassandra,export,export-to-csv
Table Name : Product uid | productcount | term | timestamp 304ad5ac-4b6d-4025-b4ea-8b7991a3fe72 | 26 | dress | 1433110980000 6097e226-35b5-4f71-b158-a1fe39a430c1 | 0 | #751104 | 1433861040000 Command : COPY product (uid, productcount, term, timestamp) TO 'temp.csv'; Error: Improper COPY command. Am I missing something? ...

How can clear apache cache?

apache,caching
How can I clear apache cache in xammp? I tried the 'htcacheclean -r' command, but it's always generated error. If I know well the apache can't cache the files/ scripts, but a system administrator said this: 'The apache casheing the site, so clear the apache(!) cache.'. ...

Apache Regex How To Get This Value

php,regex,apache,.htaccess
I have a URI like this: http://example.com/demo/makemoney?matchtype=chancee&network=agagag&ifmobile=1&placement=nyc&adposition=111&copy=25&pid=123&zid=231&mid=234&cid=342&param1=zaleemm&param2=vatansvr I want to get makemoney and after "?" character values. In my .htaccess file write this rule: RewriteRule ^demo/(.*)?(.*)$ demo.php?utm_campaign=$1&$2 [L,NC] But only utm_campaign I get in $_GET super globals. What's true regex?...

What exactly IS Kafka Rebalancing?

apache,apache-kafka,kafka-consumer-api,kafka
I am a new user to Kafka and have been playing around with it for about 2-3 weeks now. I believe at the moment I have a good understand of how Kafka works for the most part, but after attempting to play around with and design my own Kafka consumer...

PHP script doesn't execute on Apache server

php,apache
I have a very simple PHP script on a remote Apache web server. On my PC, it functions perfectly fine with php web server running but nothing appears to be executing in the web server and there appears to be no errors. I have a good suspicion that this is...

Codeigniter URL routing issues in .htaccess

php,apache,.htaccess,codeigniter-2
Before you mark it as duplicate FIY I have tried all solutions I could find on SO. The url is www.deltadigital.ca config file (if I use $config['base_url'] = 'http://www.deltadigital.ca' - it doesnt work at all) //$config['base_url'] = 'http://www.deltadigital.ca'; $root=(isset($_SERVER['HTTPS']) ? "https://" : "http://").$_SERVER['HTTP_HOST']; $root.= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); $config['base_url'] = $root;...

Xampp Starting properly but in browser localhost is not working

php,apache,xampp
I am using windows 7 and XAMPP Starting properly but in browser(ALL borwsers) localhost is not working incase of that some folders are displaying with the title searchbase. Please refer the screenshot Help me to debug this problem, I checked recently installed programs also browsers windows settings every thing looks...

.htaccess | Too many redirects

apache,.htaccess,mod-rewrite,redirect
I want to add a IP filter into my .htaccess file, but after I applied it, a too many redirects error will show. Content of .htaccess: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [L,R=301] RewriteCond %{HTTPS} on RewriteCond %{REMOTE_ADDR} xxx.xxx.xxx.xxx...

How to process argument with dot in .htaccess?

regex,apache,.htaccess,apache2,rewrite
I have this rule list in .htaccess: RewriteEngine on #RewriteCond %{REQUEST_URI} \/([0-9a-z&=\.\[\]{}%-]+)$ [NC] RewriteRule \.incl$ - [R=404] RewriteRule \.dist$ - [R=404] RewriteRule ^handler/.*$ handler/handler.php? [L] RewriteRule ^appsflyer/(.*)$ appsflyer.php$1 [L] RewriteRule ^testlead/.*$ testlead/testlead.php? [L] RewriteRule ^special/(.*)$ special/terminal.php$2 [L] #RewriteCond %{REQUEST_URI} \/([a-zA-Zа-яА-Я0-9_[\]{}%&=-]+)$ [NC] #RewriteRule ^(.*) /link_handler.php?query=%1 [L] RewriteCond %{REQUEST_URI}...

Rewrite url not working in htaccess

php,apache,.htaccess,mod-rewrite,url-rewriting
I have website. I just want to rewrite url using .htaccess Here is the code which I want to rewrite: RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} /search_data.php\?keywords=([^&]+)&f=([^\s&]+) [NC] RewriteRule ^/search_data.php/?$ /search/%1/%2? [R=301,L,NC] this the current url http://localhost/mywbsite/search_data.php?keywords=one+piece&f=149 I want to convert this to this http://localhost/mywbsite/search/one-piece/149 I tried above code but...

URL Rewrite with .htaccess From /user/projects/index.php?project_id=1 to /user/projects/1

apache,.htaccess,mod-rewrite
I'm having difficulties getting the correct code for my htaccess file to correctly rewrite my URLs. I'm trying to rewrite: www.page.com/user/projects/index.php?project_id=1 to www.page.com/user/projects/1 Here's what I have in my .htaccess file RewriteEngine On RewriteBase / RewriteRule ^projects/([0-9]+)/?$ index.php?project_id=$1 [NC,L] When I go to page.com/users/projects/1 I get a 404 error, so...

userid is not printed in Apache access logs

apache,logging,userid
I have a production setup as webSEAL --> F5 --> 2 Apache --- 2 weblogic servers. For every request webSEAL logs prints logged-in user-id and weblogic which is at the very last in infrastructure chain also have the user-id available in weblogic http access.log (not application log but weblogic internal...

Apache index.php file concurrency issue with global variables?

php,apache
I have used SLIM framework in PHP to implement some REST APIs. All the REST API code is in index.php, where I am using a global variables. Each of the REST API function sets a global variable, and another child function reads it. Now the reason to choose global variable...

Make dynamic links (with ?) return error 404 not found

apache,.htaccess,dynamic,hyperlink,http-status-code-404
Using .htaccess (are there any other solutions?) is there a way to make all dynamic links (links containing the sign ?) of a site return a 404 not found response header? For example: http://www.example.com/?bla_bla - will return 404 http://www.example.com/test/index.html?no_redirect=true - will return 404...

Rewrite folders and Remove the trailing slash at the end

php,apache,.htaccess,mod-rewrite
I'm trying to have only one URL without the trailing slash at the end of the URLs/folders, but at the same time I want to re-write this folder to use dynamic pages, for example: if I have: mydomain.com/folder mydomain.com/folder/ and mydomain.com/folder/second mydomain.com/folder/second/ then I want to open only "mydomain.com/folder" and...

URL Rewriting in php CodeIgniter using .htaccess

php,apache,.htaccess,codeigniter,mod-rewrite
I am working on a project in which url Rewriting was done. Here is the link of the old uri http://www.mysite.pk/jobs/search/faisalabad/all-cats But now in the new url I have changed it to http://www.mysite.pk/jobs/pakistan/faisalabad/all-cats what I want to do is to change the redirect all the url's whcih have http://www.mysite.pk/jobs/search/ search...

.htaccess mod_rewrite not consistent

php,apache,.htaccess,mod-rewrite
Here is a sample from my .htaccess file: RewriteEngine On RewriteRule ^login/?$ loginregister.php [L] RewriteRule ^register/?$ loginregister.php [L] RewriteRule ^member/([^/]*)$ member.php?id=$1 [L] RewriteRule ^members/?$ members.php [L] RewriteRule ^membership/?$ membership.php [L] RewriteRule ^contact/?$ contact.php [L] RewriteRule ^privacy/?$ privacy.php [L] RewriteRule ^terms/?$ terms.php [L] If I visit example.com/login, it loads example.com/loginregister.php. The...

Filtering QUERY_STRING with back references in RewriteCond

php,regex,apache,.htaccess,backreference
I have a PHP script used to process images before displaying them on the web page. The query string has to be checked to reject all requests coming from external domains. If TLD is example.com http://example.com/process.php?img=somepath/images/imgX.png OK http://example.com/process.php?img=http://example.com/anotherpath/folder/images/imgX.png OK http://example.com/process.php?img=http://anotherdomain.com/images/someimg.jpg Rejected! This rewrite rules work on my test server: <IfModule...

Is it possible to allow only the correct pretty url?

php,apache,.htaccess,mod-rewrite,friendly-url
I have these pretty urls: app/category/overview app/category/new app/category/edit/4 app/product/overview app/product/new app/product/edit/4 .htaccess RewriteEngine On RewriteRule ^([a-z]+)/([a-z]+)/?([0-9]*)$ index.phpcontroller=$1&action=$2&id=$3 [NC,L] Is it possible to define that any other other url goes back to the index? p.e. app/i/am/the/fastest/man/alive ---> app/ Help would be much appreciated!...

Applying chmod 755 (or other) when ftping to apache var/www/ virtual host directories?

linux,apache,chmod
I'm struggling to understand how to apply directory and file permissions so that files and directories created by the ftp user, via an ftp client, are browsable. In other words 755 is applied by default. I'm running Apache 2 on Ubuntu 14.04.2 LTS, Trusty Tahr, with vsftpd server. My directory...

Trouble Understanding URL Rewrite to Proxy to Another Server

regex,apache,rewrite
I am sorry if this is really simple and I am not paying attention. I need to redirect a url query (https://1.2.3.4:19999/abc/start?userid={digit string}) to be processed by another server (https://5.6.7.8/operate?service=checkuser&userid={digit string}). So far I've failed to do this correctly (this is my latest attempt): RewriteCond %{REQUEST_URI} ^/abc/ [NC] RewriteCond %{QUERY_STRING}...

How to solve com.sun.org.apache.xml.internal.security package does not exist in netbean javafx application

java,xml,apache,netbeans
I want to build .jar in NetBean 8.0.2. I have developed a small project based javafx application. My project uses packages such as com.sun.org.apache.xml.internal.security, com.sun.org.apache.xml.internal.security.c14n and com.sun.org.apache.xml.internal.security.utils. My project runs well at Netbean without warning or error. But When I build this project as jar file, following error is occurred:...

Using static href with query string in Thymeleaf

spring,apache,thymeleaf
I have a html prototype of an application, this prototype is on an Apache server, I used Apache Server Side Includes to include different pages for the template layouts. Now I'm adding labels Thymeleaf that prototype for use in an application with Spring. The problem is that many of the...

How to modrewrite in my subfolder

regex,apache,.htaccess,mod-rewrite,url-rewriting
I have a PHP script on a subfolder of my server and it generates url like this: http://example.com/subfolder//index.php?a=profile&u=username Instead I would like a SEO friendly url like: http://example.com/subfolder/profile/username.html I'm on Apache and mod_rewrite is enabled, so I edited the .htaccess of my subfolder page: RewriteEngine On RewriteRule ^([^/]*)/([^/]*)\.html$ //index.php?a=$1&u=$2 [L]...

Custon headers not working on php 5.6 - apache 2.4, debian 8 jessie

php,apache,debian,apache2.4,php-5.6
I just upgraded my debian 7 wheezy to debian 8 jessie. Apache and php were updated accordingly from apache 2.2.22 to 2.4.10 and from php 5.4.x to 5.6.9. Now when sending custom headers with ajax request, they are not present in php. Here is a simple example with index.php and...

.htaccess Mod_Rewrite inconsistent

php,apache,.htaccess,mod-rewrite
Here is my .htaccess file: RewriteEngine On #Working rules: RewriteRule ^privacy$ privacy.php [L] RewriteRule ^terms$ terms.php [L] RewriteRule ^team$ team.php [L] RewriteRule ^candidates$ candidates.php [L] RewriteRule ^clients$ clients.php [L] #Not working rules: RewriteRule ^article/([^/]*).*$ article.php?id=$1 [L] RewriteRule ^job/([^/]*).*$ job.php?id=$1 [L] RewriteRule ^contact/([^/]*).*$ contact.php?location=$1 [L] The top rules are all working...

Jetty server running SPDY behind an Apache firewall

apache,jetty,spdy,http2
I have an application at /mine running on a Jetty server that supports SPDY. It is sitting behind an Apache firewall that is being used as a proxy. The application at /mine gets routed by the following config rules on Apache: RewriteRule ^/mine$ /mine/ [R,L] ProxyPass /code/ https://jettyserver:9443/mine/ nocanon ProxyPassReverse...

.htaccess for language detection

php,apache,.htaccess,mod-rewrite
I need to work with virtual url for handling the language with folder or subfolder like www.example.com/en/xxx/ OR www.example.com/xxx/en OR www.example.com/xxx/xxx/en And all give the same ?lang=en Its possible ? Thanks you I tested this for subdomaine RewriteRule ^(.+)/$ /index.php?a=$1 [QSA,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ /index.php?a=$1...

Redirecting http to https

apache,.htaccess,redirect,ssl,https
I'd like to redirect all of my http traffic to https, currently in my htaccess file I have the following redirecting my http traffic: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </IfModule> This redirects all of my non-www to www. What is the best way to...

Change browser/system default localhost port (80) to custom

apache,xampp,localhost,wamp,wampserver
When I using XAMPP or WAMP I getting the following issue: XAMPP - Port 80 in use by "Unable to open process" with PID 4! 12 And it`s easy to solve it by changing the .ini file of Apache and tell him to use port 8080 (for example)... But then...

Apache2 log does not capture hping/ping data

apache
I am trying to put some log analyzer code that will use apache log to determine IP address of the attacker. I came across hping3 to attack DoS, ICMP attack, but if I use this command and ping apache the entries aren't recorded in the access log. Is there something...

Remove plus sign from url using .htaccess

php,regex,apache,.htaccess,mod-rewrite
My current url is: http://localhost/mywbsite/search/one+piece/149 I want to change link to like this http://localhost/mywbsite/search/one-piece/149 I have already .htaccess file with this code Options -MultiViews RewriteEngine On RewriteBase /indianrealitybytes/ RewriteCond %{THE_REQUEST} /search_advance\.php\?keywords=([^&]+)&f=([^\s&]+) [NC] RewriteRule ^ search/%1/%2? [R=301,L] RewriteRule ^search/([^/]+)/([^/]+)/?$ search_advance.php?keywords=$1&f=$2 [QSA,L,NC] I don't know where to change to remove plus(+) sign...

Redirect /{POSTID}/{CATID}/{TITLE} to just /{POSTID}/

apache,.htaccess,redirect,rewrite
I need help with a rewrite / redirect rule to fix some duplicate content issues on my website. I have a URL structure that it causing a ton of duplicate content. The same page can be accessed with: /Static1/Static2/Static3/{POSTID}/{CATID}/{TITLE} /Static1/Static2/Static3/{POSTID}/{CATID}/ /Static1/Static2/Static3/{POSTID}/ So, there are 3 copies of every page. I...

send email according time and date [closed]

php,apache,email,server
I am facing a problem with sending email about status. Basically I want to create script which send email every morning with some data from database. My goal is to write PHP file which will send email. I can create this file but I dont know how to call this...

Rewrite non-dynamic pages using htaccess

apache,.htaccess,mod-rewrite
I've been banging my head since many hours on this and I am unable to come up with a solution. What I need to get done. domain.com/page.php => domain.com/page/ domain.com/category1-name1.php => domain.com/category1/name1/ domain.com/category2-name1.php => domain.com/category2/name1/ Details: I have couple of files with the following names & I want them to...

Apache htaccess redirect file

php,regex,apache,.htaccess,redirect
I want to redirect any request for file from my old website to the same file but with different url on my new website : www.oldwebsite.com/aaa/bbb/ccc/file.txt -> www.newwebsite.com/bbb/ccc/file.txt I have tried this solution on .htaccess file: RewriteEngine On RewriteRule ^(aaa/bbb/ccc/)(.*)$ http://newwebsite.com/bbb/ccc/$2 [R=301,L] but when I try with this url :...

Apache Virtual Host redirect just for servername

apache,mod-rewrite,virtualhost
I have a virtual server, which supports just subdomains of our company. We're using Apache, and I have virtual hosts set up to serve each of these subdomains. People on our network can reach the website of these subdomains by using just the name in DNS, such as just typing...

Redirect non-www to www except subdomains by .htaccess

regex,apache,.htaccess,mod-rewrite
There are a few questions like this, but my question is a little different Redirect non-www to www in .htaccess force non www to www in htaccess Redirect Non-WWW to WWW URLs I want to redirect the non-www version of the website to www, but it should not in any...

Setting default virtual host on apache

apache,website,development-environment
I have set my local development machine to use apache to serve virtual hosts based on folders using the following setup in apache. <VirtualHost *:80> ServerName dev DocumentRoot /Users/ben/Sites VirtualDocumentRoot /Users/ben/Sites/%-2/htdocs UseCanonicalName Off <Directory "/Users/ben/Sites/*/htdocs"> AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost> Is it possible...

Redirecting all ip to maintenance page except some ips

apache,.htaccess,symfony2
When releasing new versions of my Symfony project, I need to redirect all external ip addresses to a maintenance.html page (which lives into symfony web directory) using apache. Here is the virtualhost file configuration I've created for this purpose but: When I go from an external ip I get 403...

What is difference b/w HAProxy and Apache server

apache,haproxy
Hi actually we are working on load balancing and cluster environment. So we have some confusion is this both are same or any difference between them.

htaccess rewrite url parameter

php,apache,.htaccess,mod-rewrite,url-rewriting
I want to redirect http://localhost:8080/mypproject/?supplier=test123 to http://localhost:8080/myproject/?product_cat=test123 But I don't know how......

.htacces rewrite by cookie value

apache,.htaccess,mod-rewrite,cookies,url-rewriting
I have a website in 2 languages. I'm inserting the text for each language through php constants and I define the user language through a cookie (lang=es or lang=en). Now the base url in each language is www.webname.com/ but i want to rewrite it depending on the language. If the...

deploy django under apache mod_wsgi waiting for localhost

python,django,apache,mod-wsgi
I am deploying a Django project on Apache. and after configuration, I open the "localhost" in the browser, and nothing showed up and the status bar just keep saying "Waiting for localhost". Here is some info. Environment: OS: ubuntu Python: 2.7.3 Django: 1.8.2 Apache: 2.2.21 Django project: /var/www/ocr_service Apache virtualhost:...

mod_rewrite - force redirecting to rewritten URL

apache,.htaccess,mod-rewrite,redirect
I have following URL [1]: www.domain.com/?search=somequery which i want to redirect to [2] www.domain.com/search/somequery I am using following code in my .htaccess: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^search/(.*)$ /?search=$1 [L] Code above works kind of fine since server understands both URLs:...

How to enable mod_rewrite on Apache 2.4?

php,wordpress,apache,mod-rewrite,centos7
I'm using Wordpress and wanted to enable pretty urls feature, but they don't work, i'm thinking that it's because of mod_rewrite, but i don't know how to enable it on Apache 2.4 under CentOS 7... I've already try this: grep -i LoadModule /etc/httpd/conf/httpd.conf | grep rewrite but nothing... Also would...

Apache httpd connection refused during stress test using jmeter

apache,jmeter,connection-refused
Now, I do stress test using jemter in windows(jmeter.bat). Number of Threads = 100 Ramp-up period = 0 Loop count = 1000 But raise connection refused error in jmeter, after 20~30 seconds. I can not find connection refused error in /usr/local/apache/logs/error.log or /usr/local/apache/logs/access.log. Test is HTTP GET, index.html("It's works") Apache...

mod-rewrite to remove a folder

apache,.htaccess,mod-rewrite
I have the following URL http://www.example.com/folder1/folder2/file.php I want to redirect it to http://www.example.com/demo/folder1/file.php I tried this, but it does not work: RewriteCond %{HTTP_HOST} www.example.com RewriteCond %{REQUEST_URI} ^folder RewriteRule /demo/folder(.*) /folder1/folder2/$1 ...

.HTAccess - How to modify a url with under score in file name as sub directory?

regex,apache,.htaccess,mod-rewrite
Lets say I have a directory with the following files: news_sports.html news_food.html news.html index.html How would I make it using .Htaccess so that when my website is being accessed by http://example.com/en-gb/news/sports it get's it out of news_sports.html and http://example.com/en-gb/news/food reads out of news_food.html and http://example.com/en-gb/news (with or without the slash...

How can I redirect all visitors to a subdirectory but still have access to the root directory for development

regex,apache,.htaccess,mod-rewrite,redirect
I'm about to start building a site and I've set up an "Under Construction" site at http://positivechange.cl I'd like to work directly on the root directory during development so that I don't have to move all files from a development subdirectory to the root directory, so I'd like to redirect...

How can I .htaccess 301 redirect all pages/files (EXCEPT FOR ONE) to new domain?

regex,apache,.htaccess,mod-rewrite
How can I .htaccess 301 redirect all pages/files (EXCEPT FOR ONE) to new domain? I have already made an .htaccess file that successfully redirects most all the different pages and files on my old domain (www.olddomain.com) to my new domain (www.newdomain.com). HOWEVER, I need one page to NOT be redirected...

Friendly URL using .htaccess and PHP “include”

regex,apache,.htaccess,mod-rewrite,url-rewriting
I have very little experience with PHP and using .htaccess, though I would like to create SEO-friendly URLs. I have scoured the internet and Stackoverflow searching for a problem similar to mine. I have tried multiple solutions but have had no luck and I am constantly met with errors. So...

.htaccess allow image to display directly

php,regex,apache,.htaccess,redirect
I have many files including images, php& js scripts and subfolders. I need to redirect to index.php for any uri using .htaccess. for example: www.example.com/test should be redirect to index.php But images should not be redirected to index.php. Instead it should be printed directly in browser. For example: www.example.com/sample.jpg should...

Allow space and other special characters in htaccess url rewrite

php,regex,apache,.htaccess,mod-rewrite
Hi everyone i have this URL: orderprod_cntr/147/ok2%20-%20val1%20val2%20val3%20val4 When ever i open this URL i get 404 error. The htaccess rule that i am using at present is: RewriteRule orderprod_cntr/([-\w]+)/([-\w]+)/?$ controller/orderprod_cntr.php?id1=$1&id2=$2 [L] The error is occurring due to %20 in the URL, without it works fine. Please tell me the correct...

How do I setup Apache to serve multipe local sites at different locations?

php,apache,.htaccess,drupal,drupal-7
I'm trying to setup multiple local Drupal 7 site installations on my local machine. Right now, I have a folder ~/Sites/drupal/7/{{various_drupal_sites}} I'm looking to be able to access any of these sites at site1.drupal.local, site2.drupal.local, etc. The problem is that I'm getting a 403 permission denied both at drupal.local and...

How to set default virtual server (sites-available) in Apache?

apache
I have 2 sites at my linode VPS. I configured ourdomain.com and mydomain.com in sites-available directory (/etc/apache2/sites-available/ourdomain.com.conf // mydomain.com.conf) and activated and restarted Apache. There is a way to specify ourdomain.com as the main/default site? Because when I access through the ip, Apache shows mydomain.com :(...

Particular URL redirect to http if request come from particular host

apache,http,mod-rewrite,ssl,url-rewriting
Web server is apache, ssl configured, listening on 443, All http requests will be redirected to https using rewrite rule Issues is all url's are serving through https, but we want to connect to the web server through http if the request is coming for particular url from particular host,...

guidance needed on using apache commons math

java,eclipse,apache
I am trying to utilize the Apache Commons Math (3.5) library in Eclipse IDE. I have downloaded the JAR file and have added the library to my project correctly. However my problem lies when I actually try using classes from the Apache Commons library. I try to create a new...

Dynamic inclusion of javascript in SVG by means of server side filtering inside apache server

javascript,apache,svg,piwik
Years back I wrote some code to automatically include some javascript code inside html pages delivered by an http server. The approach is documented here in a blog entry and in this StackOverflow question. The solution served me well over the last years. The approach in two sentences: for every...

Rewrite rules cause infinite redirect loop

apache,.htaccess,mod-rewrite,url-rewriting
My folder structure looks like this: /var/www/.htaccess /var/www/site/index.php /var/www/site/images/test.png Where the .htaccess file looks like this: RewriteEngine On RewriteCond /site/%{REQUEST_FILENAME} -f RewriteRule ^(.*)$ /site/%{REQUEST_FILENAME} [L] RewriteRule ^(.*)$ /site/index.php [L,QSA] Essentially, I want to rewrite all URLs to the /site/ directory, and have existing files simply rewrite to their paths in...

how to improve the performance of Apache with mod_wsgi?

apache,mod-wsgi
Use Apache/2.4.12(Unix) and mod_wsgi-4.4.11 and blow configuration of apache/conf/extra: //httpd-mpm.conf <IfModule mpm_worker_module> StartServers 3 MinSpareThreads 75 MaxSpareThreads 250 ThreadsPerChild 25 MaxRequestWorkers 400 MaxConnectionsPerChild 0 </IfModule> //httpd-vhosts.conf WSGIRestrictEmbedded On <VirtualHost *:443> ServerName form.xxx.com WSGIScriptAlias / /usr/local/apache/services/form/form.wsgi WSGIDaemonProcess paymentform user=test processes=10 threads=5 display-name=%{GROUP} maximum-requests=100...

Dissallow php execution for CSS folder with htaccess from parentfolder

php,apache,.htaccess
I have a question. I want to give one customer FTP access to the CSS folder of my webshop. I tried to prevent running PHP in this folder, but its not working. I think my problem is, that i dont want to add another .htaccess in the css folder. I...

How to Run PHP coding dynamically [on hold]

php,html,apache
I want to type php coding in textarea, then after submit it should run the php coding and produce result. Is this possible ? To upload changes in live, I need to get two level approve, If any errors occur i could't fix it quickly, If above thing is possible...

Django file upload took forever with Phusion Passenger

django,apache,file-upload,passenger
I have a Django app deployed using Passenger (I did not choose mod_wsgi because mod_passenger is already there and being used). When I uploaded an MP3 file (900 kB), Google Chrome displays upload % which reached 100% pretty fast but then it took forever for the resulting page. The database...

ssl certificate with and without www

apache,ssl
I have a website that installed a ssl certificate for the name of www.example.com. It works fine for https://www.example.com. But it doesn't work for https://example.com. The browser gave me Error code: ssl_error_bad_cert_domain. I am using Apache 2. I tried to rewrite the url to add www in httpd-ssl.conf, see the...

.htaccess URL-Rewrite solution?

apache,.htaccess,mod-rewrite,url-rewriting,rewrite
I need to rewrite my url using .htaccess The url is http://www.domain.com/subfolder/search-brands/index.php/?q=Garment Bags&brand=traveler apos s choice And i want it to work like this http://www.domain.com/subfolder/search-brands/Garment Bags/traveler apos s choice Anyone can make it? Thanks a lot for your help!...

Apache Subversion pre-commit to restrict files

apache,svn,hook,pre-commit
I'm new to Apache SVN and I need some help to use a pre-commit script to filter which files are being upload to my repository. I was searching a lot and found this script on another question, but it didn't work for me. #!/bin/bash REPOS=$1 TXN=$2 AWK=/usr/bin/awk SVNLOOK="/usr/bin/svnlook"; #Put all...

Configure Apache web server to perform SSL authentication

linux,apache,security,ssl,xampp
I'm trying to perform SSL authentication in apache web server, using XAMPP in Linux. After I configure httpd.conf like this, Apache server is failing to start. Can some one help me to fix this ? What is wrong with my configuration ? Alias /bitnami/ "/opt/lampp/apache2/htdocs/" Alias /bitnami "/opt/lampp/apache2/htdocs" <Directory "/opt/lampp/apache2/htdocs">...

Java using HTTP client 4.5 client get statements

java,apache,httpclient
I am trying to update code from Apache HTTP client 3.1 to 4.5 and I have several methods like client.getHostConfiguration, client.getState,client.getHttpConnectionManager. All of these do not work in the newer versions of httpclient so I am wondering how to rewrite these. All I see in the HTTP client documentation is...

Multiple subdomains to same address

apache,subdomain,vhosts
I want to redirect multiple subdomain to same address. Let's say I want www.sitename.com and sitename.com to redirect same address. Do I have to say; <VirtualHost www.sitename.com:81> . . . </VirtualHost> <VirtualHost sitename.com:81> . . . </VirtualHost> or is there a simple solution....

Apache Rewrite to File System Or Proxy

apache,mod-rewrite
I want to create an Apache mod_rewrite rule to do two things: Serve the contents of a file system directory when /file-system-target is requested and Proxy whenever /file-system-target is not requested. E.g.: RewriteRule ^/file-system-target /path/to/file/system/target [L] RewriteRule ^/(.*) http://localhost:8080 [P] However when watching the output of RewriteLog, the latter rule...

How to rewrite example.com/catelogue.php?page=3&cat1=fruit&cat2=apple with .htaccess

php,apache,.htaccess,mod-rewrite,url-rewriting
Can anyone help me with .htaccess rewrite url, I am new to it and stuck with this below problem i have this urls http://example.com/catelogue.php?page=3 http://example.com/catelogue.php?page=3&cat1=fruit&cat2=apple and i want this to be http://example.com/catelogue http://example.com/catelogue/fruit/apple Below is my .htaccess file, but here the problem is I have achieved this (example.com/catelogue/fruit/apple) but I...

PHP: How to read POST body with Transfer-Encoding: chunked, no Content-Length

php,apache,http-headers
I am writing a service to receive data from an energy monitoring device in my house. The only way the device can push data is by using an HTTP POST, with Transfer-Encoding: chunked, and no Content-Length, and the data as XML in the request body. I would like to be...

Parsing Apache Log Timestamps with JavaScript

javascript,mysql,apache,momentjs
I'm attempting to use moment.js to format Apache log timestamps (14/Jun/2015:11:05:54 -0700) as proper MySQL DATETIME format. Getting the MySQL DATETIME format is a breeze. But moment seems to only auto-detect ISO 8601 formats. My Node.js console output when passing in the Apache log's timestamp into moment: > moment( '08/Jun/2015:15:03:29'...

htaccess errors after upgrading Apache from 2.2 to 2.4

apache,.htaccess
I use 3 hosting for my websites, all of them have the same rules in htaccess. One of the hosting was upgraded from Apache 2.2 to 2.4 and now I am getting errors spam and I don't know how to fix it without lossing the rule. [Mon Jun 15 19:38:33.189697...

change request filename (%{REQUEST_FILENAME}) to new path in .htaccess

regex,apache,.htaccess,mod-rewrite
I'm trying to use RewriteRule in .htaccess same as Alias /var/www/html/core/ Alias /var/www/html/core/latest/. I made this .htaccess in /var/www/html/core: RewriteEngine On #Check if file exist in original path (/var/www/html/core): RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] #try new path (/var/www/html/core/latest): RewriteRule ^(.*)$...

Htaccess rewrite URL with virtual directory and 2 variables

regex,apache,.htaccess,url,rewriting
its my URL... result.php?team=arsenal&player=ospina I want to like this mysite.com/virtualdirectory/arsenal/ospina.html I tried this code.. cant work.. Not Found RewriteRule ^(.*)/(.*)/(.*).html$ result.php?team=$2&player=$3 [L] The requested URL /subfolder/arsenal/ospina.html was not found on this server. Apache/2.2.8 (Win32) PHP/5.2.6 Server at localhost Port 80 Thanks for helps, Best regards!!...

Why same .htaccess commands working differently in localhost and server?

php,apache,.htaccess,url-rewriting
I have the following .htaccess command for redirection of php pages RewriteRule ^(.*)$ index.php/$1 [L] This code is working in localhost.It is not working in web server. But when code is slightly modified it works in server. RewriteRule ^(.*)$ index.php?/$1 [L] Why is this happening?...

Unable to increase PHP Memory Limit

php,apache,memory,memory-management,out-of-memory
I am running into an issue with a project I am working with on my localhost, where I am unable to increase the PHP memory_limit setting. I've tried increasing it directly in the php.ini config: memory_limit = 1024M I've tried increasing it in the projects .htaccess file: php_value memory_limit 1024M...

Apache Alias For External Directory And All Sub Directories

apache,.htaccess,alias
I want to add a alias for my website. So that website.com/alias will go to a folder outside of the root folder. This folder contains a different website so i want to be able to treat this alias as if it were a subdomain. AliasMatch ^/subdir1/(.*)$ /var/www/otherfolder/subdir1/$1 I was hoping...

redirecting https://domain.com to https://www.domain.com

apache,.htaccess,mod-rewrite
I've recently moved my site to HTTPS and im trying to force all http traffic to https and also to the www. version i.e forcing https://domain.com to https://www.domain.com I have this in my htaccess and all http to https works, apart from the redirect from https://domain.com to https://www.domain.com What am...

Best way to block countries [on hold]

php,apache,.htaccess
I was requested to prevent access to a website. There are two ways I know I can choose - 1. At apache level (a tool like this: http://www.ip2location.com/blockvisitorsbycountry.aspx) which generates a long htaccess file with list of IP ranges. The other way I know of is using PHP (be it...

Rewriting with .htaccess doesn't work

regex,apache,.htaccess,mod-rewrite
I'm trying to make URL's look better by using a RewriteRule in .htaccess, but it doesn't work. This is the case. I have a root folder in which there is a PHP-file called pdf.php. The script in that file sends a PDF-file to the user, which name is given as...

redirect certain pages to its equivalent in another domain, otherwise redirect to its homepage

apache,.htaccess,rewrite,url-redirection
I want to use htaccess to redirect certain pages to its equivalent in another domain, other pages redirect to homepage. Like that: http://old-domain.com/certain-page redirected to: http://new-domain.com/certain-page http://old-domain.com/another-certain-page redirected to: http://new-domain.com/another-certain-page Only these pages will be redirected, otherwise, pages have to be redirected to the new domain home page. http://old-domain.com/non-certain-page redirected...

Is it possible to share session between different PHP versions?

php,apache,symfony2,session,iis
I am starting an old app refactoring, I will rebuild some functionality from spaghetti code to MVC (Symfony). Plan was I will set up new IIS app, using subdomain. Now, old app is running PHP 5.3 which can't be upgraded. New app will be running on PHP 5.6. Only thing...

PHP - On Form Submit duplicate folder with new name

php,apache,permissions,folders
Is it possible that php can create a new directory with certain files inside. For example when the php code is activated it duplicates a folder in my server directory with it's own name? I would very much appreciate if anyone could provide the start of the code I would...

Apache - finding configuration file path

windows,apache,server
I have to migrate another apache instance from 2.2 to 2.4 but I have one problem. In Apache monitor I see multiple services running but I don't really know where apache .conf files are stored. In previous migrations from 2.2 to 2.4 I had them somewhere within conf folder. Apache...

SSL is breaking my htaccess file in WordPress

wordpress,apache,.htaccess,google-compute-engine
My .htacess file is vital not only for redirection but for the look of the site. I'm not sure why the developers of this theme did this but I can't change that. If you navigate to http://akcrossfit.com you'll see the site as it should be. When you navigate to https://akcrossfit.com...

Disable direct access to application via Tomcat

apache,tomcat
I have a small local (internal to organisation) browser application running on Tomcat. I have inherited an application (also for internal organisation use only) running under PHP server which I have been asked to get running on the same box. I decided the best thing was to get both Tomcat...

Redirect only non-existing sub-directories to another domain using wildcard

apache,.htaccess,mod-rewrite,redirect
In Apache, how do i redirect all non-existing directories for one domain (E.g. http://example.com/*.*) to another (e.g. http://example2.com/*.*)? I don't want the redirect to occur if the directory exists on the first server (http://example.com/). Just for non-existing directories. Example: http://example.com/directoryA <--- Exists on the server, so it should NOT redirect....

Block all user-agents by htaccess except one

regex,apache,.htaccess,mod-rewrite,litespeed
I have a htaccess rewrite rule code which works on Apache but not on litespeed. <Files "bg.js"> SetEnvIfNoCase User-Agent .*autoit.* search_robot Order Deny,Allow Deny from All Allow from env=search_robot </Files> I want to block all useragents except those that are a case insensitive match to autoit. How do I get...

Htaccess regex: exclude REQUEST_URI

regex,apache,.htaccess,mod-rewrite,redirect
I really tried everything, the tool htaccess tester says that it's ok, but it's not really working. I want to redirect a subdomain to the main domain only if the REQUEST_URI doesn't start with 3 specific strings. I tried without success with: RewriteCond %{HTTP_HOST} ^sub.example.com$ [NC] RewriteCond %{REQUEST_URI} !(aaa|bbb|ccc) RewriteCond...

htaccess redirect to subdomain based on query string

php,apache,.htaccess,redirect,joomla
I searched for similar questions but none of them was applicable to my situation. What I need to do is redirect from old url's that have specific query string: option=com_virtuemart to a subdomain : http://parts.domain.com Tried bunch of rules and conds but haven't achieved right redirection. It was always redirecting...

AH01630: client denied by server configuration Apache

linux,apache,.htaccess,prestashop,prestashop-1.6
I get this error when trying to access localhost via a browser. 403 Forbidden I use Ubuntu 14.04 LTS Here is my configuration file: etc/apache2.conf # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See http://httpd.apache.org/docs/2.4/ for...

Pattern matching in htaccess rewrite condition

apache,.htaccess,mod-rewrite,https
I have a rewrite condition in an .htaccess file which is used to 'not' force specific URLs to use a HTTPS connection but it's matching erroneously on other URLs at present, here's the rewrite rule... RewriteCond %{HTTPS} off RewriteCond !/go/ [NC] RewriteCond %{HTTP_HOST} ^app\.ihasco\.co\.uk [NC] RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] And...

Redirection loop (URL rewriting)

regex,apache,.htaccess,mod-rewrite,rewriting
I'm trying to rewrite my website URLs. I have: http:// website.com/v2/message.php?ID2=123 I want: http:// website.com/v2/message-123.php I tried something in my htaccess but I've a redirection loop :'( Here is my .htaccess: RewriteCond %{QUERY_STRING} ^ID2=([0-9]+)$ RewriteRule message.php? http://website.com/v2/message-%1.php? [L,R=301] Can someone help me with this?...

What are correct permissions for Linux Apache2 PHP 5.3 log file?

php,linux,apache,logging,permissions
I discovered the reason why I was not getting entries into my php_errors.log file related to permissions. Right now, I have set it to 666 (rw-rw-rw-) but surely this is a security weakness? Thus, my question. php.ini file: error_log /var/log/httpd/php_errors.log log_errors On # ls -ld /var/log /var/log/httpd /var/log/httpd/php_errors.log drwxr-xr-x 6...

Datanode and Nodemanager on slave machine are not able to connect to NameNode and ResourceManager on master machine

java,apache,sockets,hadoop,tcp
I have installed hadoop on two node cluster- Node1 and Node2. Node1 is master and Node2 is slave. Node2's datanode and Nodemanager are not able to connect Namenode and Resourcemanager on Node1 respectively. However Node1's datanode and Nodemanager are not able to connect Namenode and Resourcemanager on Node1. Node1: jps...