|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
We have an awful lot of pages that use php variables to parse and i would like to rewrite these so that 1. they look cleaner and 2. users can't see how we're doing stuff or where it is.
so for example if you want to download a whitepaper you click a link that says '../resources/download.php?file=whitepapder.pdf" I would like this to be seen as ../resources/download/whitepaper.pdf and when the file is obtained and openend i do not want the url to reveal its exact location but to say www.mysite.com/resource and also when you don't fill in a complete form it returns that page with a messgae so the url reads: http://www.mysite.com/resources/down...%20your%20name Obviously it would be nice if this could just say : ../resources/download/whitepaper.pdf i know this is 3 questions in one and i realise there are a million tutorials across the net but I am not 100% sure which applies to each of my needs and though perhaps you guys could be of some help! I can see in theory how this will work its just finding the exact code to use as i have little htaccess experience. thank you so much |
|
||||
|
Mod Rewrite. & .htaccess links. Not sure if this will help you, I hope so, here's some links:-
Apache open-source software and Apache Servers. Mod Rewrite. .htaccess Files and .htaccess Help. How use to .htaccess |
|
|||
|
I bought their book on "creating a database driven site using PHP and MYSQL" and it helped me alot. I refer back to it from time to time.
Sitepoint has a book out called: "mod_rewrite: A Beginner's Guide to URL Rewriting" Here is a link to it : http://www.sitepoint.com/article/guide-url-rewriting they'll even give you four chapters for free to see if it helps you. Hope this helps Kristos
__________________
Prayer Requests |
|
|||
|
Hi
first of all your server should be linux not windows, mod rewrite works in only linux or apache server. this is a easy method you can try to find it in google , here are 2 links hope will help you. http://www.webforgers.net/mod-rewrite/#mod_rewrite http://www.webforgers.net/mod-rewrit...ite-syntax.php |
|
||||
|
# from: /resources/download/whitepaper.pdf
# to: /resources/download.php?file=whitepaper.pdf Add the following code to your .htaccess file ON YOUR LOCAL SERVER (http://localhost/...) Code:
RewriteEngine On RewriteBase /resources/ RewriteRule download/(.*).pdf download.php?file=$1.pdf [L] Code:
RewriteEngine On RewriteRule ^resources/download/(.*).pdf resources/download.php?file=$1.pdf [L] Code:
White Paper Hope it works. Rainer |
|
|||
|
In addition to previous post.
If you are going to use URL like: http://www.mysite.com/resources/down...%20your%20name You may want to transform it to: http://www.mysite.com/resources/down...%20your%20name So, you need additional rule in your .htaccess for such URLs: Code:
RewriteRule ^resources/download/(.*).pdf ?message=(.*) resources/download.php?file=$1.pdf&message=$2 [L] |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |