Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ScriptAliasMatch

Status
Not open for further replies.

CrazyHarry

Technical User
Nov 17, 2004
3
US
Hi,

I am trying to take a URL that looks like this:


and make it look like:

(so that if this is a url link on the site it will take you to

I am being told to use:

scriptaliasmatch ^/webstore/web_store.cgi?product=(.*)
/home/pmt/public_html/store/shop/

But I have no idea about the how/where/why to all this... Do I need to make another file? Where does this go? Can somebody step-by-step me? I've googled scriptaliasmatch, and to be VERY honest, I have no idea how it works.

Thanks for your help,

CH
 
I've never seen ScriptAliasMatch, but I do something *very* similar for a customer using mod_rewrite. I'll explain how it's done using rewrite rules and yoy may be able to extend that knowlege to understand what is happening in your config.

Code:
RewriteEngine on
RewriteRule ^/store/shop/(.*) /wstore/store.cgi?product=$1

The rule says:
^ says the match starts at the beginning of the URL
/store/shop/ match *exactly* this text
.* inside the parens is "match anything and everything"
() says remember what the contents of the parens matched for later use

After it matches the URL, whatever the .* matched is available for reference via "$1", so it just drops it into the GET format and calls the appropriate URL.

Hopefully this can help you understand what the other suggestion is doing.
 
Hi,

Ok, I would be willing to try this! :)

Where do I put this code? I am *very* new to this end of things.

Is there a file that it goes in?

Sorry to be such a newbie,

CH
 
Try your .htaccess, but you have to have .htaccess enabled, and you have to have mod_rewrite installed. It was intalled in my fedora rpm by default.
 
Any idea which dir .htaccess is located?

Is this something I should be able to find by searching my dirs via FTP?

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top