WordPress Permalink change won’t work

I want to update my permalink structure to postfix from the "plain" type, but every time I try--I get a 404 on every page I try to visit, except for the front page. I've reset my .htaccess, deleted it and recreated it, disabled all plugins, and then tried redoing the .htaccess with the plugins still disabled--but no luck.

I do think this was caused by the "Team" plugin by pickplugins...but still no luck when deleting that and redoing the above.

Any ideas?


Htaccess Subdomain Redirection with Wildcard

I admit I'm not an .htaccess expert so I'm hoping someone can help me.

I have a CMS installation, using the same codebase for several different subdomains. However, I want to limit the backend to the MAIN domain, even if it's accessed from a subdomain. So I'd like to set up a redirection:

http (or https)://(any subdomain).example.com/manager/(any page)

redirected to:

https://example.com/manager/(any page)

Any help would be greatly appreciated. I find .htaccess to be a bit cryptic.

Handle chunked file upload withing webserver

I would like to handle large files upload (like videos), received from a mobile application (cordova, cross-platform).

Internaly, the app is using the cordova file-transfer plugin (https://github.com/apache/cordova-plugin-file-transfer).

The application is available for android and iOS.

When I enable the chunkedMode option, the upload systematicaly fails (the server-side application result in a HTTP Bad Request because it does not receive a file. Client-side configuration is correct though, when disabling the chunkedMode option, the upload works fine, for smaller files...)

How to handle such transfers, on the server-side?

Is it the role of the server-side application, or is it the role of the webserver itself? (currently using both nginx and apache depending of the environment...)

Here is the {quite simplified} way files are uploaded by the file-transfer plugin.

It sends a multipart HTTP POST or PUT request.

It uses, for android, an instance of java.net.HttpURLConnection :

HttpURLConnection conn = null;

// Catches FileNotFoundException, IOException, JSONException, Throwable
try {
    conn = resourceApi.createHttpConnection(targetUri);

    // ...

    if (useChunkedMode) {
        // Although setChunkedStreamingMode sets this header, setting it explicitly here works
        // around an OutOfMemoryException when using https.
        conn.setRequestProperty("Transfer-Encoding", "chunked");

And for iOS, an instance of NSMutableURLRequest :

NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:url];

[req setHTTPMethod:httpMethod];

if (chunkedMode) {
    CFReadStreamRef readStream = NULL;
    CFWriteStreamRef writeStream = NULL;
    CFStreamCreateBoundPair(NULL, &readStream, &writeStream, kStreamBufferSize);
    [req setHTTPBodyStream:CFBridgingRelease(readStream)];

    [self.commandDelegate runInBackground:^{
        if (CFWriteStreamOpen(writeStream)) {
            if (multipartFormUpload) {
                NSData* chunks[] = { postBodyBeforeFile, fileData, postBodyAfterFile };
                int numChunks = sizeof(chunks) / sizeof(chunks[0]);

                for (int i = 0; i < numChunks; ++i) {
                    CFIndex result = WriteDataToStream(chunks[i], writeStream);

Is there something to install/configure/enable for nginx and apache to do the work?

Or does the server-side application itself has to play with such requests, like re-composing chunks into physical file manually?

Multilingual website: Make fake redirects to non-existent subfolders

in the current state, my website is accessible through several language-specific top-level-domains. The .htaccess-file catches the domain ending and sets the language with the help of SITE_LANGUAGE=[lang]


SetEnvIf Host ".de$" SITE_LANGUAGE=de

My goal is to unify them all in a http://example.com/lang/ Pattern.

How can i achieve the following:

1. User opens the website with language-specific top-level-domain (for example: .jp).

2. Tell search engines, that the domain is permanently changed to the new pattern

3. .htaccess changes the domain in the adressbar to .com/jp/

4. Set the language depending on the (non-existent!) sub-folder

5. If the user opens .com/jp/index.php (or any other file), the file must be loaded from .com/ instead

6. For the user it has to appear that the file is loaded from .com/jp/index.php (in the adressbar)

How do I write these htaccess rules as one rule instead of multiple?

I have these rules in my htaccess. one is for the main domain of the server and the others are other domains that are pointed at the server.

the purpose is to redirect subdomains to a url that is written a certain way. the main domain excludes certain subdomains from the redirect.

RewriteCond %{HTTP_HOST} !^(www|dev|mydev|something|somethingelse)\.maindomain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-.]+)\.maindomain\.com [NC]
RewriteRule ^(.*)$ https://maindomain.com/index/parser.php?%2&domain_name=maindomain.com [QSA,L]

RewriteCond %{HTTP_HOST} ^(.*)\.anotherdomain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-.]+)\.anotherdomain\.com [NC]
RewriteRule ^(.*)$ http://anotherdomain.com/index/parser.php?%2&domain_name=anotherdomain.com [QSA,L]

RewriteCond %{HTTP_HOST} ^(.*)\.whatever\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-.]+)\.whatever\.com [NC]
RewriteRule ^(.*)$ https://whatever.com/index/parser.php?%2&domain_name=whatever.com [QSA,L]

I don't want to keep having to add a new 3 lines for each new domain pointed at the server. How do I create one rule set to incorporate any domain that is pointed at the server? I would still need certain subdomains to be excluded from the main domain, but it wouldn't matter if the same subdomains are excluded from all the domains.

here are a couple things I tried. neither works.

#attempt 1
RewriteCond %{HTTP_HOST} ^(?:www\.|)([a-z0-9-]+)\.(.+\.(?:[a-z]{2}\.[a-z]{2}|[a-z]+))$ [NC]
RewriteRule ^(.*)$ https://%2/index/parser.php?%1&domain_name=%2 [QSA,L]

#attempt 2
RewriteCond %{HTTP_HOST} !^(www|dev|mydev|something|somethingelse)\.(.+\.(?:[a-z]{2}\.[a-z]{2}|[a-z]+))$ [NC]
RewriteRule ^(.*)$ https://%2/index/parser.php?%1&domain_name=%2 [QSA,L]

SSI includes not working on server but working locally

I'm developing a website locally with USBWebServer (Apache, PHP, MySql) and I wanted to use SSI, so I could include stuff like header, footer and so on.

In my .htaccess I have put following directives:

Options +Includes

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

I have main index.shtml and inside it I have directives:

<!--#include virtual="./files/navbar.shtml" -->
<!--#include virtual="./files/contact.shtml" -->

and it works just fine.

However, when I upload site to my webserver, with the same directives in .htaccess, index.shtml cannot include anything.

My current workaround is to change index.shtml to index.php and to use php includes like:


, but I would like to know why SSI doesn't work as expected on the server and what can I do to make it work with .shtml?

how to deny the client from accessing the webapp while he has physical access to the server

I'm delivering a webapp as an on-prem and the client has a physical access to the server (ubuntu) using LAMP stack.
What is the possible scenarios I can do to deny the client from accessing the files inside www folder ? while he can access the app itself from the browser
user permissions is not a suitable way since the client can install the HDD on another machine and access the while files

APACHE BEAM- Issue while reading from hive

Hello i get this error when i try reading from Hive. Can someone please help me with this. Also i have never given configuration details before for my cluster for hive but beam just doesn't allow you to do anything without having the following as config. I tried many options for key and values for mapping but i get this below error every time. Can someone help in spotting what would be the exact problem?

Also to just let you guys know that 2.1.0 Beam which is not yet released resolved this issue for me but very curious why could not achieve this with 2.0.0

Configuration hcatConf = new Configuration();
hcatConf.setClass("mapreduce.job.inputformat.class",HCatInputFormat.class, InputFormat.class);
hcatConf.setClass("key.class", LongWritable.class, Object.class);
hcatConf.setClass("value.class", HCatRecord.class, Object.class);

This is however giving me an error when i try to run.

Caused by: java.lang.IllegalArgumentException: Forbidden IOException when reading from InputStream
at org.apache.beam.sdk.util.CoderUtils.decodeFromSafeStream(CoderUtils.java:133)
at org.apache.beam.sdk.util.CoderUtils.decodeFromByteArray(CoderUtils.java:113)
at org.apache.beam.sdk.util.CoderUtils.decodeFromByteArray(CoderUtils.java:107)
at org.apache.beam.sdk.util.CoderUtils.clone(CoderUtils.java:156)
at org.apache.beam.sdk.io.hadoop.inputformat.HadoopInputFormatIO$HadoopInputFormatBoundedSource$HadoopInputFormatReader.cloneIfPossiblyMutable(HadoopInputFormatIO.java:707)
at org.apache.beam.sdk.io.hadoop.inputformat.HadoopInputFormatIO$HadoopInputFormatBoundedSource$HadoopInputFormatReader.transformKeyOrValue(HadoopInputFormatIO.java:696)
at org.apache.beam.sdk.io.hadoop.inputformat.HadoopInputFormatIO$HadoopInputFormatBoundedSource$HadoopInputFormatReader.getCurrent(HadoopInputFormatIO.java:669)
at org.apache.beam.sdk.io.hadoop.inputformat.HadoopInputFormatIO$HadoopInputFormatBoundedSource$HadoopInputFormatReader.getCurrent(HadoopInputFormatIO.java:584)
at org.apache.beam.runners.spark.io.SourceRDD$Bounded$ReaderToIteratorAdapter.tryProduceNext(SourceRDD.java:189)
... 34 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:197)
at java.io.DataInputStream.readLong(DataInputStream.java:416)
at org.apache.hadoop.io.LongWritable.readFields(LongWritable.java:47)
at org.apache.beam.sdk.io.hadoop.WritableCoder.decode(WritableCoder.java:84)
at org.apache.beam.sdk.io.hadoop.WritableCoder.decode(WritableCoder.java:53)
at org.apache.beam.sdk.coders.Coder.decode(Coder.java:160)
at org.apache.beam.sdk.util.CoderUtils.decodeFromSafeStream(CoderUtils.java:130)
... 42 more