Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

rewrite address bar url to include index.php if not there

Posted on 2004-05-03
5
Medium Priority
?
626 Views
Last Modified: 2013-11-18
lets say I have the following site
http://mysite.com/mydir/

I need a way do that is a user goes to mysite.com/mydir
they will be redirected to http://mysite.com/mydir/index.php.

I know index.php is the default, but I want this to be displayed in the address bar. can I use mod_rewrite, and if so how.

just to recap I want all valid combinations of urls to display http://mysite.com/mydir/index.php in the address bar. This includes mysite.com/mydir, mysite.com/mydir/index.php, http://mysite.com/mydir.

any help would be great
0
Comment
Question by:shainegordon
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10977938
Redirect /mysite/   http://www.mysite.com/index.php
0
 

Author Comment

by:shainegordon
ID: 10978958
I used php instead to check the $_SERVER['REQUEST_URI'] for the presense of index.php. if not found I echoed a javascript window.location=index.php

that was enough for my needs.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10979038
and how about browsers without JavaScript?

Also keep in mind that your browser still requested a file, otherwhise you could not have used php-code on the server.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 11785210
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

    PAQ - refund

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Periwinkle
EE Cleanup Volunteer
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11812618
PAQed, with points refunded (100)

modulo
Community Support Moderator
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question