Log in with username/password: lyceum/lyceum

Ticket #370 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

mod_rewrite mystery

Reported by: jjb Assigned to: jjb
Priority: high Milestone: 0.32
Keywords: stumped Cc:

Description (Last modified by jjb)

When trying to access this url:

http://example.com/lyceum/mySlug/admin/admin.php?import=rss

mod_rewrite intercepts it and destroys it:

rewrite wp-admin/admin.php -> wp-admin/.php?b=wp-admin&b=mySlug&import=rss

The thing is, I thought Lyceum's mod_rewrite rules would skip over any and all requests for files that actually exist, which is the case here.

Requesting a "vanilla" url (actual directory path to admin.php):

http://example.com/lyceum/wp-admin/admin.php?b=mySlug&import=blogger

results in the same problem.

	RewriteEngine On
	RewriteBase /

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d

	RewriteRule ^profile/? wp-admin/profile.php?%{QUERY_STRING} [L]
	RewriteRule ^login/? wp-login.php?%{QUERY_STRING} [L]
	RewriteRule ^register/? wp-register.php?%{QUERY_STRING} [L]

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d

	RewriteRule ^([A-Za-z0-9_-]+)/admin/?$ wp-admin/index.php?b=$1&
	RewriteRule ^([^/]+)/admin/?([^/]+php)\??(.*) wp-admin/$2?b=$1&%{QUERY_STRING} [L]

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d

	### do we need these two conditions? ###
	RewriteCond %{REQUEST_URI} !^(.+)/admin(.*)
	RewriteCond %{REQUEST_URI} !^(.+)/index.php(.*)

	RewriteRule ^([A-Za-z0-9_-]*)/? /index.php?b=$1 [L,QSA]

Change History

04/13/06 16:38:12 changed by jjb

  • description changed.

04/13/06 20:50:54 changed by jjb

  • priority changed from normal to highest.

04/17/06 18:06:13 changed by jjb

  • description changed.

04/20/06 00:52:41 changed by jjb

  • status changed from new to closed.
  • resolution set to fixed.

this has been mysteriously fixed. possibly from changeset:683, using a base path instead of path to portal.php.

05/05/06 00:08:22 changed by jjb

  • status changed from closed to reopened.
  • resolution deleted.

looks like this has resurfaced. look at ticket:400 and ticket:405

05/09/06 20:17:21 changed by jjb

  • milestone changed from 0.30 to 0.31.

05/09/06 20:20:44 changed by jjb

  • description changed.

05/09/06 20:21:13 changed by jjb

  • description changed.

05/09/06 22:42:29 changed by jjb

  • priority changed from highest to high.

05/11/06 16:01:10 changed by jjb

the problem is only with directory style URLs, and not with subdomains.

05/12/06 01:04:37 changed by war59312

Hey,

Perhaps just:

RewriteRule ^admin/admin.php?$ wp-admin/index.php$1?%{QUERY_STRING} [QSA,L]

Take Care,

Will

05/12/06 03:04:19 changed by jjb

  • milestone changed from 0.31 to 0.32.

05/12/06 21:08:06 changed by jjb

note to jjb: duh, look at the differences between the subdomain and directory rewrite rules in classes.php

05/13/06 01:19:38 changed by jjb

  • description changed.

05/13/06 04:04:19 changed by jjb

  • status changed from reopened to closed.
  • resolution set to fixed.
Log in with username/password: lyceum/lyceum