500 Internal Server Error after importing Duplicator in Custom

If I drag and drop the .zip duplicator file into Local and live the Environment as Preferred (nginx as default) everything goes fine. But if I change it to custom and select Apache. The import goes fine but the trying to visit de site gives a 500 Internal Server Error.

logs.zip (2.6 KB)

Hi Alex,

Sorry for the trouble!

Also, thanks for sending the logs right away.

It looks like there’s a bad line in .htaccess. Can you provide the contents of the .htaccess file that’s in the site’s app/public folder?

Here’s the specific error:

[Fri Dec 01 07:52:58.079744 2017] [core:alert] [pid 365:tid 140268758050560] [client 172.17.0.1:44148] /app/public/.htaccess: RewriteRule: bad flag delimiters

Just noticed the same error here while re-importing my sites from Local exported zips (after a High Sierra Clean install).

And yes, it’s the .htaccess –– while exporting or importing, Local must have mangled it from

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress 

to some frankensteinian

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ # BEGIN WordPresswp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) 
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ # BEGIN WordPresswp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) 
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ 
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
 [L]
RewriteRule . index.php [L]
 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ 
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ # BEGIN WordPresswp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) 
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ 
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
 [L]
RewriteRule . index.php [L]
 [L]
RewriteRule . index.php [L]
# END WordPress

(Both .htaccess are the same site, first from this mornings TimeMachine backup; second from re-imported Local .zip).

1 Like

I’ll make sure that’s patched up in 2.2.1.

Thanks for providing the .htaccess file!

FYI, I think it’s strictly the # BEGIN WordPress ff stuff that’s being mangled.
Stuff like WP Rocket’s instructions in .htaccess look good.

Hi I have the same problem. Made backup with Duplicator on my xamp wp site on windows and wanted to import it to local on my mac with Apache+PHP7.2+SQL 5.6 and it doesnt work only with the preferred 1.3.2 enviroment. Any solutions? I didn’t understand the above…