Can't preview pages, all links go to home page
-
Hi, I’m brand new to WordPress and to the forum.
My goal is to add a WordPress blog to my existing website. I have installed WP on my existing site in a directory named ‘blog’ under the root of the domain.
Thus:
https://www.mysite.com/ is the home page of my website
https://www.mysite.com/blog/ is my blog’s main pageHowever, when I try to add a post or edit the sample page all the preview links go directly to the home page of the website… instead of the page/post I’m trying to edit.
I finally found that if I added this line to the .htaccess file at the root of the site:
RewriteRule ^(/)?$ blog [L]
… then, all my preview links and navigation on those pages worked perfectly. However, it also caused the link for https://www.mysite.com/ to be redirected to https://www.mysite.com/blog/ thus rendering the existing website unreachable.
I can’t figure out how to edit the .htaccess file in order to make the existing website reachable AND allow the links for preview (and all the links to posts, etc. on the actual blog page) to be correct. I think I need to have this redirect in the .htaccess file and I’ve tried putting it in numerous places in this file, but haven’t hit on the solution.
I’m sure it is something simple but I have not discovered it. I am using the Weaver II theme, if that makes any difference.
Here is my complete current (root) .htaccess file. This version allows the main website to be seen at the domain address but all the blog editing links, etc. do not work properly (as described above):
——————————
RewriteEngine on
DirectoryIndex home.html
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName mysite.com
RewriteCond %{HTTP_HOST} ^mysite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.com$
RewriteRule ^denise\.html$ “https\:\/\/sec\.mysite\.com\/secmysite\/uploadform\.mgi” [R=301,L]# BEGIN WordPress
# END WordPress
——————————Since I didn’t actually create this .htaccess file (i.e., Apache did via cPanel) I’m not too confident about simply changing any of it, and frankly I’m not sure what is needed, and what might not be needed.
When I added the ‘RewriteRule ^(/)?$ blog [L]’ line, I added it above # BEGIN WordPress; I also tried it between # BEGIN WordPress and # END WordPress. Both of these make my links work but redirect away from my ‘home.html’ page as the domain address for the existing website.
There is also a .htaccess file in my ‘blog’ directory, which simply shows:
DirectoryIndex index.php
I don’t see any other .htaccess files anywhere on this website.
Any help will be most appreciated. Laughing and pointing is OK, too.
- The topic ‘Can't preview pages, all links go to home page’ is closed to new replies.