Forum Moderators: phranque
My idea is to make a folder for the script (called scriptfolder for example) and have an htaccess file in the folder to do the url rewrites. so to call the script, you could go to:
[thesite.com...]
and the htaccess would redirect to:
[thesite.com...]
I don't know if it's possible to have the script be in the same folder as the redirect htaccess, nor do I have any idea of what the htaccess file should look like; the only stuff i've done with httpd and htaccess is custom error pages, directory indexes, and password protection. I hate to ask this, but can someone write me the htaccess file, or at least give me an idea of what the syntax for the regex (is that what rewritecond uses?) looks like? I hope I gave an accurate description of my problem.
Regards,
Brian
Welcome to WebmasterWorld!
We expressly discourage the writing of code on demand here; Please understand that the demand would far outstrip the ability of our small number of contributors to keep up. However, we will certainly support your effort to get started.
See the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com] for background information and examples, and also try searching this site for examples using the keywords "mod_rewrite," "rewriterule," "query string," etc.
Be aware that mod_rewrite works in the URL-to-filename translation phase of the Apache API, before any content is served and before any scripts are invoked. Therefore, it is likely that you will want to rewrite your search-friendly URLs to the form required by your script. You can place an .htaccess file in any HTTP- accessible directory on your site, and all rules will be applied hierarchically, with rules in subfolders overriding rules in their parent folders (in a standard Apache configuration).
Jim