Jump to content

Recommended Posts

Hello,

 

Could anyone point me in the right direction with regards to URL Rewriting.

 

I have a site e.g. www.domain.com

 

This site has a subdirectory which runs a membership script e.g. www.domain.com/membership

 

Almost all of the functions of the membership script are handled by one file e.g. www.domain.com/membership/process.php

 

Functions occur when different variables are passed to the script e.g. www.domain.com/membership/process.php?update will show a form where users can update their details.

 

What I would like to do is to rewite the URL so that users can access process.php and it's functions via www.domain.com/process.php instead of www.domain.com/membership/process.php

 

Is this possible using .htaccess?

 

I did try to do the above by adding <?php include'membership/process.php?update'; ?> to www.domain.com/process.php but this doesn't work as variables are not passed!

 

Thanks!

 

Link to comment
https://forums.phpfreaks.com/topic/268585-using-url-rewriting-htaccess/
Share on other sites

Even if the script is at /process.php it still needs to know whether to update or something else.

 

If you're still passing that in the URL like

www.example.com/process.php?update

then all you need* in /process.php is

The real script will still have $_GET and $_POST like it normally would.

 

 

But a question: how about just moving the file? Does it really need to be in two places?

 

 

* Probably. There are a few reasons why you might need something else.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.