You are currently viewing How to Change the Name of index.php in WordPress

How to Change the Name of index.php in WordPress

Spread the love

Example 1: Regular WordPress Site

Change this

## This line might not yet be present.
## Should add it for security
DirectoryIndex index.php

# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

To

DirectoryIndex blog.php index.php

# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^blog\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog.php [L]
</IfModule>

# END WordPress

Example 2: WordPress MultiSite Using Subdomains

Change this

## This line might not yet be present.
## Should add it for security
DirectoryIndex index.php

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]

# END WordPress

To

DirectoryIndex blog.php index.php

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^blog\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . blog.php [L]

# END WordPress

source = http://journalxtra.com/websiteadvice/change-index-php-wordpress-4576/

Bir yanıt yazın

Bu site, istenmeyenleri azaltmak için Akismet kullanıyor. Yorum verilerinizin nasıl işlendiği hakkında daha fazla bilgi edinin.