apache rewrite rule cleanup, props filosofo, fixes #13540
git-svn-id: http://svn.automattic.com/wordpress/trunk@14914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
68bfd98708
commit
1bb1502499
|
@ -433,30 +433,30 @@ define( 'BLOG_ID_CURRENT_SITE', 1 );</textarea>
|
|||
<?php } else {
|
||||
// Construct an htaccess file.
|
||||
$htaccess_file = 'RewriteEngine On
|
||||
RewriteBase ' . $base . '
|
||||
RewriteRule ^index\.php$ - [L]
|
||||
|
||||
# uploaded files
|
||||
RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n";
|
||||
RewriteBase ' . $base . '
|
||||
RewriteRule ^index\.php$ - [L]
|
||||
|
||||
# uploaded files
|
||||
RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n";
|
||||
|
||||
if ( ! $subdomain_install )
|
||||
$htaccess_file .= "\n# add a trailing slash to /wp-admin\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]' . "\n";
|
||||
|
||||
$htaccess_file .= "\n" . 'RewriteCond %{REQUEST_FILENAME} -f [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^ - [L]';
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^ - [L]';
|
||||
|
||||
// @todo custom content dir.
|
||||
if ( ! $subdomain_install )
|
||||
$htaccess_file .= "\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
|
||||
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]';
|
||||
$htaccess_file .= "\nRewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]";
|
||||
|
||||
$htaccess_file .= "\nRewriteRule . index.php [L]";
|
||||
|
||||
?>
|
||||
<li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
|
||||
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>">
|
||||
<?php echo wp_htmledit_pre( $htaccess_file ); ?>
|
||||
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"><?php
|
||||
echo wp_htmledit_pre( $htaccess_file );
|
||||
?>
|
||||
</textarea></li>
|
||||
</ol>
|
||||
<?php }
|
||||
|
|
Loading…
Reference in New Issue