Rewrite from Apache httpd... over again

Hello guys,

My first post about: Roots.io Bedrock - WordPress + (sub-domain | sub-directory) + Caddy

Today, the WP from Bedrock give me the tip:

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) wp/$1 [L]
RewriteRule ^(.*\.php)$ wp/$1 [L]
RewriteRule . index.php [L]

The goal:

  1. hide the wp directory.
  2. hide the /index.php/ to permalink structure into WordPress

Note: I have a WordPress with Roots Bedrock and Multisite.

MyCaddyfile Caddyfile:

(wordpress) {
	rewrite {
		r ^/index.php/(.+)$
		to /{1} /index.php?{1}
	}
	rewrite {
		if {path} not_match ^((\/wp)?(\/wp-admin))(\/network)?
		to {path} {path}/ /index.php{query}
	}
}

It works, but do not remove the wp directory.

I have tried an attempt - no sense, yeah:

rewrite /wp {
	r  ^(wp-(content|admin|includes).*)
	to /wp/{1}
}

Any suggestions? Idea?

Maybe try:

rewrite {
  to /wp{path} /wp{path}/ /wp/?{query}
}

Then browse to your site without the /wp/ prefix, which the rewrite should then prepend for you behind the scenes.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.