WordPress.org

Ready to get started?Download WordPress

Forums

Way to redirect domain to index.html but still view wordpress pages (7 posts)

  1. kirtis_njones
    Member
    Posted 1 year ago #

    I'm looking for a way to have my domain redirect to an index.html page, but still be able to view the pages I've created so I can edit them further. I have edited my htaccess page to redirect to the index.html, but now when I try to view a wordpress page, it redirects to the .html instead of the page I was trying to edit or view.

  2. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Do you want your permalinks to have .html, something like http://example.com/this-is-my-best-post.html?

  3. peter achutha
    Member
    Posted 1 year ago #

    Why do you want to redirect to index.html? Would not making a static page as home page do the same thing? Go to WP control panel, Settings > Reading and set Front page displays 'A static page' (radio button) then select which of your WP pages is to be the front page.

    Also index.html has priority over index.php so if someone types in your domain name eg http://www.mydomain.com he will see index.html even if both files, index.html & index.php are there and WordPress will not get loaded.

    Was that what you were looking for?

  4. kirtis_njones
    Member
    Posted 1 year ago #

    That is what I want to do pete. Have a static page (with just a screenshot of the future site on it) display instead of the wp pages i'm building. I have an index.html and index.php in the root folder, however without the redirection from htaccess, it seems that the index.php (wordpress) is taking priority. With the redirection, when I try to preview a page created in wordpress, it automatically redirects to the index.html page and I can't view any changes I've made to the page in wordpress. I apologize for not being more clear.

  5. peter achutha
    Member
    Posted 1 year ago #

    That is interesting! Index.php taking priority over index.html.

    You can try putting this in your .htaccess file

    DirectoryIndex index.html index.php

    Order of priority is left to right. That should change your server to take index.html as priority index file but if you need to access WordPress then go for index.php. I hope this works as I have never experienced this before. Better still check with your server tech support why index.php has priority over index.html .

  6. kirtis_njones
    Member
    Posted 1 year ago #

    Thanks for the help pete. I thought it was very strange that .html wasn't taking priority, but it seems like thats what's going on. Since most of what I need to do is styling, I've just been "breaking" htaccess to update the page, reinstalling it to take the static page back, and styling with firebug on the "updated" on the backend. Not to most elegant solution but unfortunately I need to get this done rather than get down into the nitty-gritty and figure out whats really going on =/. Ces't La Vi.

    Thanks again for the help.

  7. goshenw
    Member
    Posted 6 months ago #

    Anyone who's searching for a solution to this problem (as originally posted), the answer is here: !!

    wordpress.org/support/topic/how-can-i-turn-off-wordpress-indexphp-redirect-to-domain-root

    My server defaults to index.php, so I also had to put a line of code at the top of the .htaccess file:

    #default index page
    DirectoryIndex index.html index.php //index is default

    Much better that trying to use wordpress static pages, for which you have to mess with your themes / page templates to get it to display without all the header and footers etc.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.