My dynamic php website doesn't work properly with wordpress
-
Okay, hope i don’t screw up the formatting. ?? I have a few issues, please bear with me. Link To My Site
1) WordPress displays fine at first, then clicking internal links (IE making a comment) it’s no longer dynamic with my php setup.
2).htaccess is not writable regardless of setting it to the extreme 777 permissions.
3)I believe #1 issue is related to the fact that my site URL is set to https://example.com/Blog. It’s treating ‘Blog’ as a directory when in fact Blog is just a rewrite for index.php?page=blog.php. Also I believe this same issue is causing links in the menu to change. The moment you click on Blog, the links in the menu change from (Home|Blog|Forum..etc) to (BlogHome|BlogBlog|BlogForum..etc)Site directory
public_html <--real root agentc0re <---pseudo root & main website root blog <---Wordpress installation
My PHP code in my index.php is as follows (sorry for all the comments i reverted it to it’s most simple stage for troubleshooting purposes)
<?php //if(isset($_GET['page'])) { $page = $_GET['page']; /* gets the variable $page */ //$page = basename($page); //} //else{$page = 'index.php';} if (!empty($page)) { $page .= '.php'; /*if(!file_exists($page)) { $page = "home"; }*/ /*else { include '404.shtml' }*/ include($page); } /* if $page has a value, include it */ else { include('home.php'); } /* otherwise, include the default page */ //include 'home.php'; include('menu.php'); ?>
What this says. Make index.php into calling pages via index.php?page=
whatever page=, strip the .php off the end for a nicer display. Next include the page IE index.php?page=blog. Other wise include home.php and then finally include my menu.php.As of right now wordpress “Works” but only because of these rewrite rules
<IfModule mod_rewrite.c> RewriteEngine On #RewriteBase /blog/ ##RewriteRule ^index\.php$ - [L] RewriteCond %{HTTP_HOST} ^(www.)?agentc0re.com$ RewriteRule ^Blog/?$ /index.php?page=blog [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /agentc0re # RewriteRule ^Home/?$ /index.php?page= [L] #RewriteRule ^Blog/?$ /index.php?page=blog [L] RewriteRule ^Forum/?$ /index.php?page=forum [L] RewriteRule ^Sub_Counter/?$ /agentc0re/index.php?page=/SubCounter/subCounter [L] RewriteRule ^AboutMe/?$ /index.php?page=aboutme [L] RewriteRule ^Contact/?$ /index.php?page=contact [L] </IfModule>
Explaining #2 issue more is i don’t believe that it’s even reading the .htaccess located in the wordpress directory because of the fact that my siturl being https://example.com/Blog, <–it treas Blog as a directory. Blog does not exists, therefore .htaccess cannot be written. But, Blog is just a rewrite rule that actually calls
index.php?page=blog.php
Where blog.php is just a copy of the index.php inside the wordpress folder except that the require directive is set to,
require( dirname( __FILE__ ) . '/blog/wp-blog-header.php' );
What I want to happen – TL;DR
Have the whole wordpress site load just like how it first loads when you click on the Blog link on the menu for the first time. I want to be able to display my menu/header & have the loading screen present along side wordpress.Figure out why wordpress treats my site url of ‘Blog’ as a dir instead of a file. I could make a symlink but im not sure if thats the proper way to handle this.
Figure out why wordpress is appending Blog to my menu links.
WOW, i know this is a lot to digest, and I appreciate it if you made it this far. I know there are a lot of problems to tackle but i’ve been posting EVERWHERE & I am hoping someone here can help me out.
Thank you SOOOO very much.
-Jon
- The topic ‘My dynamic php website doesn't work properly with wordpress’ is closed to new replies.