Link to home
Start Free TrialLog in
Avatar of emory7
emory7

asked on

Mod Rewrite

I'm trying to shorten the urls below using .htaccess so that the category called "Web Development" and subcategory "HTML Tools" will appear as directories. Specifically, the category url:

http://www.mydomain.com/tools/software/showpads.php?cat=Web%20Development

needs to appear as:

http://www.mydomain.com/tools/software/web_development

and subcategory url:

http://www.mydomain.com/tools/software/showpads.php?cat=Web%20Development%3A%3AHTML%20Tools

should appear as

http://www.mydomain.com/tools/software/web_development/html_tools

Thanks in advance.

ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of emory7
emory7

ASKER

Hi,
I put the above code in .htaccess in the root and then tried it in the "software" directory (where the database script is installed). I got a server error both times. Wondering what I might be doing wrong?

Thanks much.
You need to provide exactly what the server error is to help us.

Possible problems:

Is mod_rewrite loaded
Is mod_alias loaded before mod_rewrite
Do you have the line 'RewriteEngin on' after the module is loaded

Try changing RewriteLogLevel to 3 instead of 0, and tell us what errors you get in the log file.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oooops - should be:

'RewriteEngine on'

with an 'e' in my first posting!
One of the problems with putting this sort of thing into .htaccess, is that the web server has to find the .htaccess file from the URL, which involves resolving the URL in filestore.

I always put this sort of rewrite in the httpd.conf file, which requires access to the file, but allows me to rewrite almost anything ionto anything else.