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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oooops - should be:
'RewriteEngine on'
with an 'e' in my first posting!
'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.
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.
ASKER
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.