close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

.htaccess page

Thread began 3/13/2010 6:07 pm by Gizza372666 | Last modified 3/17/2010 8:21 pm by Gizza372666 | 892 views | 4 replies |

Gizza372666

.htaccess page

Hi Eric,
can you please include a .htaccess page on the registration solution to remove the extensions?
registration/users_Profile.php?
What I will like to have is just the domain (www.mydomain.com) to show and not the path: (users_Profile.php?)
I will like to remove the following from the address bar:
registration/users_Profile.php
Can you please help me to achieve this?
Thanks

Sign in to reply to this post

Jimmy Wu

Here is a guide on how to create the .htaccess file to rewrite the url:
mod_rewrite

If you run into any issues, please let me know and I will assist as best I can.

Sign in to reply to this post

Gizza372666

Originally Said By: Jimmy Wu
  Here is a guide on how to create the .htaccess file to rewrite the url:
mod_rewrite

If you run into any issues, please let me know and I will assist as best I can.  



Hi Eric,
Sorry I can understand it.
Can you please give me a specific example for the following case (this hopefully will enable me to understand it).
Here is what I have:
On the User_profile page I have created a link so the user will be directed on a page that he/she will be able to upload a picture. (<a href="add_image.php?UserID=<?php echo $row_WAATKusers['UserID'];?>" target="_blank">)
The problem is that they will be able to see their ID e.g.
UpdateBanner.php?UserID=94
Which means that if you type 95 it will go to the UserID=95 and they will be able to change someone else’s picture.
if i could add the right command on the .htaccess page to remove this (?UserID=94), they will not be able to do this.
Can you please help me write the .htaccess page?
This is what I have tried but it gives me error 500
RewriteEngine on
RewriteCond %{QUERY_STRING} ^
RewriteRule ^(.*)$ $1 [L,R=301]
RewriteCond %{THE_REQUEST} ^\?UserID=(.*)$ HTTP [NC]
RewriteRule ^$UpdateBanner.php%{REQUEST_URI} [R=301,L]
HELP!!!

Sign in to reply to this post

Jason ByrnesWebAssist

I think you are misunderstanding what modrewrite is capable of.

modrewrite can be used to convert query string variables into friendly urls, for example:

change:
UpdateBanner.php?UserID=94

to:
UpdateBanner.php/UserID/94

but the query string variable still needs to be in the URL for the php server to be able to use.


if you created a rule to strip the UserID variable, it would just redirect to the UpdateBanner.php page with that variable empty.

With the user registration solution pack, when a user logs in, a session variable named "UserID" is created that contains the Id of the logged in user. Why not use the session variable on the UpdateBanner.php page:
$_SESSION['UserID']

instead of the passing it through the query string?

Sign in to reply to this post

Gizza372666

Thanks for the reply.
Job done!
I just managed to understand sessions
This is what I need it (Sessions)
Thank you very much.

Sign in to reply to this post

Gizza372666

This post has been deleted.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...