![]() |
Simple rewrite problem
I need to make a simple rewrite apache rule so anything after #! in the URL gets redirected to index.php?page={TheString}
I tried this RewriteEngine on RewriteRule ^/([0-9][0-9])/$ http://localhost/221New/test.php?page=$1 but i get a 500 server error, can anyone see why or would i need to post more code? thats all i currently have in my htaccess file |
Check your error log. You may not have mod_rewrite installed/enabled.
|
The error i get is
[Mon Jan 16 14:46:20 2012] [alert] [client ::1] /Applications/XAMPP/xamppfiles/htdocs/221New/.htaccess: Invalid command '{\\rtf1\\mac\\ansicpg10000\\cocoartf824\\cocoasubrtf480', perhaps misspelled or defined by a module not included in the server configuration I guess that means its not installed? Im using XAMPP, how would i go about installing it on there? |
This page explains how to enable AllowOverride on OSX: http://blog.1on1.ro/2008/02/25/enabl...x-105-leopard/
Your httpd.conf is like in this folder: /Applications/XAMPP/ or /Applications/XAMPP/apache rather than the path they mention. |
Thanks, that helped :) apache now seems to be running okay.
Im having a little trouble with writing the rule though, i need it to pick up uppercase letters, lowercase letters and underscores what are after #! so i tried RewriteRule ^#!([a-zA-Z_])$ test.php?page=$1 but that didnt work, can you see what im doing wrong? |
Quote:
|
Yeah just did a bit of research and found that out :(, time to rethink my plan :p
|
| All times are GMT +1. The time now is 04:58 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.