• Hi,

    How can I rename index.php of wordpress to something else? if I rename the file it doesn’t work in blog.

    Kindly let me know thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Don’t. You’ll break stuff, big time. Why are you asking?

    Thread Starter James David

    (@primeaz)

    I have a website where I want to change the permalink to remove /blog/ in the post this is the link

    https://mpatches.com/blog/?p=1"

    I have followed this

    https://www.wpbeginner.com/wp-tutorials/how-to-get-rid-of-wordpress-from-your-wordpress-site-url/

    I have to move my index.php on root folder but then index.aspx doesn’t work for the root folder and taken by index.php

    so that’s why I want to rename the index.php so that index.aspx works fine for the domain and also /blog/ removal works as well for the wordpress.

    Hi, @primeaz!

    I would suggest another approach:

    1. Rename index.aspx to homepage.aspx
    2. Create a WordPress custom theme template file containing:

    <?php
    /*
    Template Name: My ASPX Homepage
    */
    echo file_get_contents("https://www.yoursite.com/homepage.aspx");
    ?>

    3. Create a wp page that uses My ASPX Homepage as template
    4. Set that page as the static front page.

    That way, your homepage will be loaded trough wordpress and will still display your aspx file.

    You can read more about integrating your website with wordpress here

    https://codex.www.ads-software.com/Integrating_WordPress_with_Your_Website

    Hope this helps.

    • This reply was modified 4 years, 2 months ago by Vlad T. Reason: code updated
    Dion

    (@diondesigns)

    .aspx files are serverland ASP.NET scripts, much like .php files are serverland PHP scripts. The above “solution” to load/display the .aspx file will not work.

    Anyway…I’m sure this can be accomplished by adding a custom web.config file in the WordPress root directory. You’ll need to get in touch with an ASP.NET developer, or perhaps you can find a solution on StackExchange.

    The url has nothing to do with the index.php. Index.php is required to run. If you change or rename it you will break the site. There are 2 required files for a wordpress theme index.php and style.css. If you remove or rename either your site will fail. Don’t change the extention to .aspx wordpress uses php. If you want to change the Permalink go to settings->Permalinks. You will find options to change the link. Don’t rename files unless you know what you are doing.

    Thread Starter James David

    (@primeaz)

    I think the only way i can think of is somehow allow my root directory to listen only to index.aspx and restrict index.php so that mydomain.com works for index.aspx and not for index.php

    then it will be all good. I have contacted host provider to see if this is possible.

    asp and php are totally different programming languages they have nothing to do with each other. WordPress uses templates to create the site. Index.php is the fall back for all templates if they don’t exist. WordPress calls the correct templated based on the data that is being displayed. Asp isn’t used in wordpress at all.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘how to change rename index.php’ is closed to new replies.