Forum Moderators: phranque

Message Too Old, No Replies

Using rewrite rules in .htaccess

Need help on rewrite rules on hosted setup - can't use httpd.conf for this.

         

TorbenGB

12:30 pm on Feb 13, 2004 (gmt 0)



I'm looking for help concerning rewrite rules for a challenging setup. I'm on a hosted site so I can't edit httpd.conf (or else this would have been easy). I need to do some URL rewriting using .htaccess rules.

What I have (examples):
[mysite.com...]
[mysite.com...]
[mysite.com...]
and so on.

What I want (examples):
[mysite.com...]
[mysite.com...]
[mysite.com...]

Basically there's a fixed /cgi-bin/ that contains scripts that take the rest of the URL as parameters (/Category-name and /Topic-name and?UrlParam).

I want to always hide the /cgi-bin/ part, and if the script name is 'view' then I also want to hide that. Other script names (like 'edit' in the examples above) should be kept in the URL.

I have checked that I can use the RewriteEngine on my site, but I have no experience with creating RewriteRules to achieve what I want. I've bookmarked http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html [httpd.apache.org] but it's tough for a newbie to grasp that from scratch.

Can anybody help me out?

jdMorgan

7:37 pm on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



TorbenGB,

Welcome to WebmasterWorld [webmasterworld.com]!

In accordance with our charter [webmasterworld.com], we cannot offer code-writing services here. There are simply not enough people here who can take the amount of time that would be required to answer all requests. We will be happy to help you debug your own code, however.

I would suggest reading this thread, and following the links in the first post: Introduction to mod_rewrite [webmasterworld.com]

This site search [google.com] might give you a good overview of the other considerations involved in rewriting static to dynamic URLs.

Jim