runeveryday — 2013-04-02T10:56:07-04:00 — #1
n my site root directory. there are donghua.php and index.php. now, is there a way to use .htaccess file to let the visitor access my site .the default shows example.com/donghua.php. not example.com/index.php. thank you. the server is Apache.
ps:The user still can access example.com/index.php
in the .htaccess. the default page is ok. but when i access example.com/index.php it redirect to example.com/donghua.php. if i forbid it redirect how do i do?
jeff_mott — 2013-04-02T12:36:43-04:00 — #2
So... the problem is that index.php redirects to donghua.php, but you don't want that to happen?
If that's your question, then we're going to need more information. Either one of your other htaccess rules is causing the redirect, or something in index.php is causing the redirect. We can't check either one unless you show them to us.
runeveryday — 2013-04-03T02:22:44-04:00 — #3
when access the site(http://www.example.com). i want it shows the content(http://www.example.com/donghua.php). and when i access http://www.example.com/index.php directly, it also work.
john_betong — 2013-04-03T02:50:32-04:00 — #4
Is this what you want to happen when these URI are called:
"http://www.example.com/" goes to "http://www.example.com/donhua.php"
"http://www.example.com/donhua.php" goes to "http://www.example.com/donhua.php"
"http://www.example.com/index.php" goes to WHERE EXACTLY
runeveryday — 2013-04-03T10:12:33-04:00 — #5
yes, you are right. http://www.example.com/index.php go to http://www.example.com/index.php
john_betong — 2013-04-03T22:20:20-04:00 — #6
Why not follow standard practise and make items one and three activate index.pup and donhua.php to go to a separate page?
runeveryday — 2013-04-03T22:51:52-04:00 — #7
in donghua.php i invoke a flash. so i want to when the user access the site it will show the flash. there is a link on the flash. (enter the site)example.com/index.php
john_betong — 2013-04-03T23:19:54-04:00 — #8
I have searched and unable to find a .htaccess solution to your problem.
Can you post a link to your site and other posters may be able to help.
runeveryday — 2013-04-04T10:34:15-04:00 — #9
i want to access the site(http://www.hf-cgp.com/) shows the flash http://www.hf-cgp.com/donghua.php . then click enter the site(at bottom of the site.) the site is made by wordpress.
john_betong — 2013-04-04T12:15:18-04:00 — #10
Why not have a splash screen with two links:
pullo — 2013-04-04T14:42:21-04:00 — #11
Create a .htaccess file in the root of your website and add this line to it:
This should do what you want.
runeveryday — 2013-04-04T22:54:27-04:00 — #12
this made you can't access example.com/index.php. when your access it will redirect to example.com/donghua.php
runeveryday — 2013-04-04T22:56:07-04:00 — #13
how to make when the user open the site. it shows http://johns-jokes.com/downloads/sp-b/donhua/
john_betong — 2013-04-04T23:12:05-04:00 — #14
Just modified the link:
- No .htaccess required
- index.php now has source displayed at the bottom of the page
- index.php has two buttons, one links to the donhua.php the other to a new index_main.php
- index.php now loads very quickly
pullo — 2013-04-05T07:16:57-04:00 — #15
That's weird, it shouldn't!
Try clearing your cache to ensure that your browser hasn't cached a previous redirect.
Here's an example demonstrating that it does work.
I created a directory entitled "directoryIndex-example"
In this directory I placed three files, "index.php", "donhua.php" and a .htaccess file.
The .htaccess file contained this:
Now, if you go to the following url, you are directed to donhua.php
However, if you navigate to either file directly, then things still work as expected:
Saying all of that, I find John's solution much better, as it gives your visitors a choice in what they look at.
Also, remember that iOS devices don't support Flash.