![]() |
Can't get mod_rewrite to work correctly
Hi there,
I'm trying to set up mod_rewrite rules to clean up my URL's. I have a page colours.php which can hold any of the following vars: colours.php?s=1 colours.php?s=2 colours.php?s=3 I would like to display these as colours/red colours/green colours/blue Now I've been trying for quite a while and I just cant seem to get it to recognise the pattern when I include the colour. However, as a test to see if RewriteRules were working, I tried just setting the base page to direct to colour 3 using the following: Code:
RewriteRule (.*)colours(.*)$ colours.php?s=3As soon as I add the specific colour in the pattern however, it stops working and gives me a 500 Internal Server Error: Code:
RewriteRule (.*)colours/blue(.*)$ colours.php?s=3 |
Colour => number map it PHP side. Ignore the 1-3.
Code:
RewriteEngine onPHP Code:
Now you should be able to use colours/blue or colours/2 and result in the same output. Try that. |
Hi,
I am using WAMP with Drupal 7. I enabled the mod_rewrite module in httpd.conf to enable clean url's in drupal however since then I am unable to run my website due to 500 internal server error. When checked the Apache log I see ".htaccess: RewriteRule: bad flag delimiters". I am unable to figure out the reason for this error. Below is the content for .htaccess placed in website root Code:
# |
The problem is going to be in your .htaccess file - confirm it by uploading the original drupal one (or download the drupal zip again and get it there) and ensure everything works fine.
If the problem resides in your htaccess file then let me know and I'll take a closer look for you. |
| All times are GMT +1. The time now is 03:14 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.