1

I have a bit of a complicated situation. I'm working on a landing page with an enter link (index.php). The landing page is index.html, however, I am using wordpress rewrite rules to load the entire site as if it were in the index directory.

The wordpress files are in /wordpress/, whereas the site when loaded from mydomain.com loads each page without /wordpress/.

The problem is, when the mydomain.com is loaded, by default index.html is loaded. The link contains an index.php href, but when clicked it brings me back to index.html. I know why it does this, but not sure how to, or if it's even possible to make a rewrite rule to aid this situation.

Here's my htaccess:

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

# END WordPress

Any help or guidance is appreciated. Thank you!

8
  • Provide more information about how you define your href for index.php Commented Jul 28, 2014 at 4:35
  • @OlegGryb Do you mean <a href="index.php">link</a> ? Commented Jul 28, 2014 at 6:51
  • Yep and I don't understand why it redirects back to index.html when you click on this link. Since you wrote that you do understand, probably you can explain. Commented Jul 28, 2014 at 7:13
  • I wouldn't have asked the community if I didn't have this problem. I'm not sure why either, though it probably does come from the line RewriteRule . /wordpress/index.php [L]. I do believe that it comes from trying to call an index that is rewritten as the default directory, basically to remove /wordpress/ from the path when called. Commented Jul 28, 2014 at 17:08
  • That rule could explain why it gets redirected to index.php, but I still don't understand how it can be redirected back to index.html. Probably you should provide more details about index.html page. Probably something is wrong with the 'href' Commented Jul 28, 2014 at 17:39

1 Answer 1

1

I think this will be helpful to you.

Make index.html default, but allow index.php to be visited if typed in

DirectoryIndex index.html index.htm default.htm index.php index.php3 index.phtml index.php5 index.shtml mwindex.phtml

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.