I dont want to re-direct the person in any way just show the link as the root of the domain on whatever file is requested in the adirectory folder.
Is this possible? I think myself as pretty resourceful and I have spent the last hour looking for an answer and cant find anything that explains exactly what I want to do.
mod_rewrite translates requested URIs (URLs people type into the browser bar, or that they reach by clicking a link) into an underlying file to respond to that request
For example, you can have a request to / (the root of the domain) rewritten to /adirectory/Whatever.php. The URL the user requested is still /, that’s still what’s shown in their browser address bar, but the contents of Whatever.php are returned to the browser.
I think I am getting confused about what modrewrite is for then.
basically there is a bunch of files in a directory and I dont want the user to see the name of the directory that they are in. In the example “adirectory” so I though that mod rewrite would display (or mask) the url as coming from the root.
If there is anywhere you can point me, that would help.
Well, it’s “masking” adirectory by displaying the contents of Whatever.php at /, a URL that does not include /adirectory. You can do the same for all requests, rewriting them to serve the file by the same name in /adirectory while the URL requested does not include /adirectory.
mod_rewrite won’t change what the user typed or any existing links
So the first question is, what are the users typing or clicking? Or is there no site yet and you’re still planning that?
The user is clicking a link to a form which is then bouncing from form to form collecting information as it goes so the first page is followed by a clickable link to
And you want to get rid of /directory without moving step1, step2, step3 and finish.php?
Write a rewrite rule, that matches a request for /step1.php, /step2.php, /step3.php or /finish.php, and rewrites it to /directory/step1.php, /directory/step2.php, /directory/step3.php and /directory/finish.php
Then update your code so that it uses the URLs without /directory/ when redirecting after each form submit. If your forms still redirect to /directory/ mod_rewrite isn’t going to change that.