w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » APACHE » Page 1
how Apache htaccess rewrite if the file exists
You can use this rule from your root .htaccess: RewriteEngine On RewriteBase / RewriteCond %{DOCUMENT_ROOT}/data/cache/list_game.html -f RewriteRule ^game/?$ data/cache/list_game.html [L,NC] RewriteRule ^game/?$ index.php?m=Home&c=Game&a=lst [L,QSA,NC]

Categories : Apache

Redirect first page of pagination to main page
With that: RewriteEngine on RewriteCond %{QUERY_STRING} ^p=1$ RewriteRule ^(.+)$ $1 [R=302,QSD,L] [QSD] work only since Apache 2.4.0. If it's not your case, use: RewriteRule ^(.+)$ $1? [R=302,L] Change R=302 for R=301 when test work well.

Categories : Apache

Apache Activemq and Mqtt
The only way for MQTT Clients do decide what Messages to get is by subscriptions. These can either be a concrete Topic ("Aaaa/Bbbb/Cccc") or a Wildcard Topic string ("aa/#/cc" or "aa/bb/+/cc")

Categories : Apache

Use Environment Variables with If Statements
We can be tempted to write this: #SetEnvIf Request_URI "^" DISPLAY_ERRORS=off SetEnv DISPLAY_ERRORS off <If "-T env('DISPLAY_ERRORS')"> php_flag display_errors off </If> <Else> php_flag display_errors on </Else> But it seems that <If> is evalued before any SetEnv(If). Note that the value of a variable may depend on the phase of the request processing i

Categories : Apache

Apache pig,programe issue
Try like this A = load 'bomb' USING PigStorage(':') as (name:chararray,word:chararray); B = GROUP A BY name; C = FOREACH B{ filterByBomb = FILTER A by word MATCHES '.*bomb.*'; GENERATE group,COUNT(filterByBomb.word); } STORE C INTO 'output' USING PigStorage(':'); Output: pras:1 sasi:2

Categories : Apache

Mod_rewrite simple redirect
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^www.example..com [NC] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ http://%{HTTP_HOST}%{foo} </IfModule>

Categories : Apache

Rewriting folder won't work
Since the /image/ directory doesn't actually exist, it'll get trapped by the first rule that routes everything to index.php. Assuming your htaccess file is in your document root, you need to add the rule above your routing rule and change it to this: RewriteRule ^image/(.*)$ image/$1 [L] If your htaccess file isn't in the document root, then you need to add this rule to the top of the htaccess

Categories : Apache

htaccess rewrite removing php error
Try replacing %{REQUEST_FILENAME} with %{REQUEST_URI}: RewriteEngine on RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule !.*.php$ %{REQUEST_URI}.php [QSA,L] Or may be better if your rule looked like: RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/$1.php -f RewriteRule ^(.*)/?$ /$1.php [QSA,L]

Categories : Apache

Only allow redirects within the same domain with mod_rewrite
You can try to use the following to check the domain in query string and show 403 Forbidden if it's an external one: RewriteBase / RewriteCond %{QUERY_STRING} !^.*yourdomain.com.* [NC] RewriteRule .? - [F]

Categories : Apache

Mesos scheduler getting duplicate status updates
Mesos promises to send status updates to the framework scheduler at-least-once, in order. That means that the slave has a queue of pending status updates, and will continue sending the last unacknowledged status update until it receives an acknowledgement from the framework scheduler. This should be done automatically by the SchedulerDriver, but if you have a lot of updates from a lot of executors

Categories : Apache

Spark Graphx with Hbase table as Input
consider using apache phoenix instead of raw hbase api, it's a sql layer/JDBC driver for hbase, then you can use JdbcRDD to import data to spark, and once it's loaded use Graphx or SchemaRDD

Categories : Apache

camel: error handling during route startup
I would need more information to provide you with a more exact answer; however, it looks like you should be able to use the onException clause as part of RouteBuilder configuration. Here is an excerpt from the JBoss Camel guide: Scopes The onException clauses can be effective in either of the following scopes: RouteBuilder scope—onException clauses defined as standalone statements inside a Rou

Categories : Apache

MessagingException: Missing start boundary when sending mail with attachment
Possible solutions: See Missing start boundary Exception when sending messages with an attachment file in Tomcat. The solution suggests to check the classpath. See Missing start boundary Exception when reading messages with an attachment file. The solution suggests to set property mail.mime.multipart.ignoreexistingboundaryparameter: System.setProperty("mail.mime.multipart.ignoreexistingboundar

Categories : Apache

How I can create a camel globalObject?
If you want to setup your route, then you may use PropertyPlaceholderConfigurer, see here: <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="activemq:${someQueueName}"/> <to uri="mock:results"/> </route> </camelContext>

Categories : Apache

mod_rewrite rule to allow a single URL to be served without SSL
You're merely failing to negate ! the RewriteCond. That should be all you need (though you can simplify it by removing the () capture group and $ anchor). RewriteCond %{SERVER_PORT} 80 # Negate the condition with !, and the (.*)$ isn't needed. RewriteCond %{REQUEST_URI} !^/preview/ RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I would probably simplify the RewriteRule to match

Categories : Apache

How to aggregate many marshalled (json) objects to one file
Meanwhile i added a simple aggreagtor: public class LineAggregator implements AggregationStrategy { @Override public final Exchange aggregate(final Exchange oldExchange, final Exchange newExchange) { //if first message of aggregation if (oldExchange == null) { return newExchange; } //else aggregate String oldBody = oldExchange.getIn().getBody(String.class); String

Categories : Apache

mod_rewrite works incorrectly on apache 2.4
Change this rule: RewriteCond %{REQUEST_URI} !.(.+)$ RwriteRule manage/(.*?)/$ manage/index.php [QSA,L] To RewriteCond %{REQUEST_URI} !.(.+)$ RwriteRule manage(/.*)?$ manage/index.php [QSA,L]

Categories : Apache

what is the significance of log retention period in kafka?
Once the retention hour is over all the messages will be discarded no matter consumed or not. Here is a brief note from the official documentation The Kafka cluster retains all published messages—whether or not they have been consumed—for a configurable period of time. For example if the log retention is set to two days, then for the two days after a message is published it is available f

Categories : Apache

PIG: Invalid field projection. Projected field [dept_no] does not exist in schema
Can you try like this? D = FOREACH grouped{ only_chem = FILTER managers BY dept_no == 'chem'; GENERATE FLATTEN(only_chem); } DUMP D; if this doesn't work, please paste your sample input data of employee and managers files and also 2 load stmt.

Categories : Apache

How to get the number of words per line in pig?
if it is the problem with an empty bag then you can try something like this: (Not tested) raw = load file; words = FOREACH raw GENERATE TOKENIZE(*) as tokenized_words; counts = FOREACH words GENERATE ((tokenized_words IS null or TRIM(tokenized_words) == '') ? 0 : COUNT(*)) as total_count; here we are writing if-else condition to check if the tokenized_words is null or empty, if yes then we ar

Categories : Apache

RewriteRule for the dynamic part of url which is not permanent
You can add two different rules. First, when all three parameters are present; and then for the case where only two parameters are present. RewriteRule ^([^/]+)/id(d+)/(d+)/?$ /?page=$1&id=$2&location=$3 [L] RewriteRule ^([^/]+)/id(d+)/?$ /?page=$1&id=$2 [L]

Categories : Apache

Apache Spark: pyspark crash for large dataset
Mrutynjay, Though I do not have definitive answer. The issue looks like something related to the memory. I also encountered the same issue when trying to read a file of 5 MB. I deleted a portion of the file and and reduced to less than 1 MB and the code worked. I also found something on the same issue here in the below site as well. http://apache-spark-user-list.1001560.n3.nabble.com/pyspark-Fa

Categories : Apache

Can Apache prepend a header file to any request?
Yes, you can achieve this by setting auto_prepend_file option in the php.ini (PHP configuration). This will only work when other PHP files are requested.

Categories : Apache

graphite not displaying rrd files in the ui
Maybe your Graphite instance is missing RRD support because you haven't installed python-rrdtool as mentioned in the Graphite installation document? I suppose Graphite checks for the availability of this module and if missing disables RRD support.

Categories : Apache

.htaccess redirect with 2 parameters
Go like this: RewriteEngine On RewriteCond %{REQUEST_URI} ^/index.php [NC] RewriteCond %{QUERY_STRING} page=([^&]+) [NC] RewriteCond %{QUERY_STRING} article=([^&]+) [NC] RewriteRule .* /%1/%2/? [R=302,L] RewriteCond %{REQUEST_URI} ^/index.php [NC] RewriteCond %{QUERY_STRING} page=([^&]+) [NC] RewriteRule .* /%1/? [R=302,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQ

Categories : Apache

Forbidden You don't have permission to access / on this server. [Apache/2.2.22 (Debian)]
default file in sites enabled directory is fine and working with virtualhost.It was permission related issue.Though permissions were granted but it was not being updated. The problem was caused as filetype was ntfs and after formatting to ext4 format and giving permission to directory. problem got resolved. Conclusion. If facing such issue check file format and check permissions to directory are

Categories : Apache

Transfer .htacces to web.config, 302 redirect
Yes, this is in web.config file that you have to do it. You can add a rewrite block into it for your rule <rewrite> <rules> <rule name="Redirect to new domain" stopProcessing="true"> <match url="^(.*)$" /> <action type="Redirect" url="http://www.mynedomain.com/{R:1}" redirectType="Found" /> </rule> </rules> </rewrite> In

Categories : Apache

Why does spark-shell throw ArrayIndexOutOfBoundsException when reading a large file from HDFS?
There's probably an entry in the dataset that does not follow the format and therefore: elm.split(": ")(1) fails, because there's no element at that index. You can avoid that error by checking the results of the split before accessing the (1) index. One way of doing that could be something like this: var tupleSet = datasetObj.map(elem => elm.split(": ")).collect{case x if (x.length>1) x(1)

Categories : Apache

Shutting down a website using HTaccess does not work
Just this rule in root .htaccess should be able to handle this: RewriteEngine On RewriteBase / RewriteRule !^shutdown.html$ shutdown.html [L,NC] Now you can keep custom HTML content in /shutdown.html. Keep in mind you need to use inline css/js since it will also rewrite css/js requests to /shutdown.html file.

Categories : Apache

Spark Streaming is killed every after 2 hours
Maybe the stream receiver is stopped. do you use something like this in your code? streamContext.stop(true, true); If the stream receiver is stopped and you are listening to the receiver then the context will stop too.

Categories : Apache

.htaccess rule seemingly ignored
You Marionette rule should be like this: <ifModule mod_rewrite.c> DirectorySlash Off RewriteEngine On RewriteCond %{THE_REQUEST} ^.*/index.php RewriteCond %{REQUEST_URI} !^/api/ [NC] RewriteRule ^(.*)index.php $1 [R,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{THE_REQUEST} !s/+(index.php|api/) [NC] RewriteRule

Categories : Apache

Virtual host setup < cgi script
Thanks to Justin Iurman Who wrote the following as a comment, witch solved most of it: In <Directory "/var/www/joppli-bot"> block, replace AllowOverride None by AllowOverride All (otherwise your htaccess is disabled) I also added DirectoryIndex joppli.bot at the bottom of my .htaccess file to route all trafic from root directory to the script as well..

Categories : Apache

Printing ClusterID and its elements using Spark KMeans algo.
as I know you should run predict for each elements. KMeansModel clusters = KMeans.train(parsedData.rdd(), numClusters, numIterations); List<Vector> vectors = parsedData.collect(); for(Vector vector: vectors){ System.out.println("cluster "+clusters.predict(vector) +" "+vector.toString()); }

Categories : Apache

What does Curator mean by in the background?
It means asynchronous. ZooKeeper APIs are either synchronous or asynchronous. The synchronous versions wait for completion before returning. The asynchronous versions return immediately and report success/failure via a callback method.

Categories : Apache

How does one download from archiva 2.1.1 rest api?
Consult the following .wadl: http://< your_host_name>:< your_port>/archiva/restServices/archivaServices?_wadl After some trial and error using the provided .wadl, I was able to successfully query the REST API for a known, existing artifact using Chrome's Postman. I started with observableRepoIds, since it doesn't require parameters. Next, I moved on to a resource with only 1 parame

Categories : Apache

redirect a domain with http to different domain with https
You can use that: RewriteCond %{HTTP_HOST} ^(www.)?test.org$ RewriteRule ^/?$ http://some.com/ [R=301,L] or with all the final URL (test.org/xxxx/yyy...) RewriteRule ^/?(.*)$ http://some.com/$1 [R=301,L] But, I don't really know what is your problem, or error...

Categories : Apache

In GraphX - is there a way to pattern match on an EdgeTriplet?
Just do like the following (t:EdgeTriplet[Foo,Bar]) => (t.srcId, t.dstId, t.edgeAttr) match{ case (0, 1, edgeAttr) => case (stcId, dstId, edgeAttr) if ... => ... case _ => Unit }

Categories : Apache

Human readable String date converted to date using Pig?
1.Pig support only few formats of date, so you need to convert your date and time according to any one of the below format. http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html 2.Your input has BST as timezone but in pig BST is not supported, so you need to choose a different timezone which is equivalent to BST. Timezones are available here http://joda-time.sourceforge.net/t

Categories : Apache

Rewrite condition only running the first one
The variable %{HTTP_HOST} only contains the HTTP request header. The URL part is not available to this variable. Therefore, the rules would have to be changed as follows: RewriteEngine On RewriteCond %{HTTP_HOST} ^staging.domain.com$ [NC] RewriteRule ^((?!work/?).*)$ http://domain.com/blog/$1 [R=301,NC] RewriteCond %{HTTP_HOST} ^staging.domain.com$ [NC] RewriteCond %{REQUEST_URI} ^/work/? [NC] R

Categories : Apache




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.