• Answers
  • Web

Apache redirecting help

How would I redirect my users from

example.com/blah/index.php

if that was typed in to

example.com/blah/

with apache or php?

For cleaner urls.


Share Send to a friend Watch Report
 
 

Posted Answers

 
17 helpful answers

You probably shouldn't need to, because any call to example.com/blah/ is going to look for the default page, which is ought to be index.php already.  If you don't see index.php when you go to example.com/blah/ then you need to set the DirectoryIndex property in a .htaccess file.  This is easy enough:

DirectoryIndex index.php

Once you have that sorted out, you can try adding the redirect in the same .htaccess file:

Redirect 301 /blah/index.php http://www.example.com/blah/

Posted 2007-07-18T21:43:33Z

Sign in to participate

Got an answer for bum99? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


Q:

How can I generate logs on an Apache Server for ...

How can I generate logs on an Apache Server for specific pages on my website for the purpose of importing them into Webtrends?
Submitted by dojojpbjs   1 year ago.
  • viewed 86 times


Q:

Which is best web hosting?

Which is best web hosting? I want to buy web hosting for my new website. Here is a review, Top 10 web hosting but I still don't ...
Submitted by satelliii   2 years ago.
  • viewed 664 times
Last answer posted 18 days ago by elaine


Q:

Choosing a New Web Hosting Plan

I've been shopping for a new web host. I am confused about the bandwidth history of my current host. What is the difference ...
Submitted by changebox   2 years ago.
  • viewed 1249 times
Last answer posted 21 days ago by mrjo1



» More...

Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
  • Answers
  • Web
Copyright © 2006-2009, Yedda Inc. and respective copyright owners · CC License