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?
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.
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.
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
yes, you are right. http://www.example.com/index.php go to http://www.example.com/index.php
Why not follow standard practise and make items one and three activate index.pup and donhua.php to go to a separate page?
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
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.
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.
Why not have a splash screen with two links:
Create a .htaccess file in the root of your website and add this line to it:
This should do what you want.
this made you can't access example.com/index.php. when your access it will redirect to example.com/donghua.php
how to make when the user open the site. it shows http://johns-jokes.com/downloads/sp-b/donhua/
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
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.
This topic is now closed. New replies are no longer allowed.