We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Mod_Rewrite
Topic Started: Jan 22 2007, 04:54 PM (502 Views)
jarocks
Member Avatar
Gods don't need a title.
[ *  *  * ]
How would i use mod_rewrite so that i could take a url www.example.com/$user and have it load the file www.example.com/page.php?user=$user but still see www.example.com/$user
Offline Profile Quote Post Goto Top
 
Ben
Member Avatar
Quantum-locked when observed.

A List Apart has a wonderful article on this very subject, URLS! URLS! URLS!

Regular expressions have never been my forte, so I recommend that you read the above article, as it walks you through the process, so that you can decide what sort of regex you need and what security precautions to put in place, etc.
Offline Profile Quote Post Goto Top
 
jarocks
Member Avatar
Gods don't need a title.
[ *  *  * ]
its not helping
i need one that will take a url specific to an image
like www.example.com/images/example.gif
and make it www.example.com/images.php?img=example.gif
Offline Profile Quote Post Goto Top
 
Jory
Member Avatar
Member
[ *  *  *  *  *  * ]
Code:
 
RewriteRule ^images/([A-Za-z0-9_\-]+).gif$  images.php?img=$1[L]

That should do the trick.
Offline Profile Quote Post Goto Top
 
jarocks
Member Avatar
Gods don't need a title.
[ *  *  * ]
is there a way to combine all the image types into 1 rule
Offline Profile Quote Post Goto Top
 
jarocks
Member Avatar
Gods don't need a title.
[ *  *  * ]
sorry for the dubble post but i keep getting the following error
No input file specified.
Offline Profile Quote Post Goto Top
 
jarocks
Member Avatar
Gods don't need a title.
[ *  *  * ]
is there a way you can use mod rewrite and keep get variables on the url
such as
www.example.com/index.php?page=1&p=m& ...
and make it
www.example.com/page1/?p=m& ...
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply