473,321 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

mod_rewrite question

9
I'd like to redirect URLs in a directory in this way:

categories/anything/index.php?id=13 to
categories/index.php?id=13

To achieve that, I've uploaded a .htaccess file to "categories" directory that contains the following:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^[.*]/index\.php\?id=([0-9]*)$ index.php?id=$1
</IfModule>

But it keeps giving a 500 error

How do I fix this?

Many Thanks
Aug 2 '08 #1
1 1870
Atli
5,058 Expert 4TB
What does the error log say?

My guess is that it is the [.*] that is causing the problem. The asterisk should be outside the class, and seeing as there is only one character, the class isn't really needed.

So I would try something like:
Expand|Select|Wrap|Line Numbers
  1. RewriteRule ^.*index\.php\?id=([0-9]*)$ index.php?id=$1
  2.  
Sep 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Westcoast Sheri | last post by:
Hello. How do I do this: If a visitor types in any number after my url, I want mod_rewrite to convert it to my url/anotherpage.html?number=number_visitor_typed Example: ...
2
by: Jon Maz | last post by:
Hi All, Forgive a newbie-ish question here, but I've not been long in the Apache / PHP world. I'm just learning about mod_rewrite, and a question occurred to me. Once Apache has rewritten a...
11
by: joelbyrd | last post by:
I have a people-networking type site in which each user has their own profile page, with their user id encoded. So, for example, the web address of their page might look like...
3
by: Rik G. | last post by:
I'm trying to replace a PHP query string with virtual directories using Apache's mod_rewrite. Here's my test .htaccess: RewriteEngine on RewriteRule ^qqq$ database.php?cat=0 RewriteRule...
0
by: cxer | last post by:
Hi friends, i write rules at below, RewriteEngine On RewriteBase / RewriteRule ^prefabrik/(.*)/(.*).html index.php?id=$2&pl=$3 RewriteRule ^prefabrik/(.*)$/images/(.*)$ images/$2
2
by: jwriteclub | last post by:
I have a question regarding back button functionality in an "ajaxy" web application. Here is the scenario: The user navigates to a page http://domain.com/app/. Since app/index.php file...
3
by: dennis.sprengers | last post by:
* I'm trying to work out some rewrite rules that should do the following: case 1: a request to mysite.com: rewrite http://www.mysite.com/files/sheets.ppt to...
3
by: Kevin Audleman | last post by:
When you type in a url without a filename, e.g. www.google.com/, it automatically looks for index.php (or whatever your web server is configured to look for). I am having the problem where my CMS...
11
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
With Apache's mod_rewrite module I can keep *.php files and load them as *.html files: # Make http//example.com/foo/bar.html load /home/site/foo/bar.php RewriteEngine On RewriteRule...
7
by: Dale | last post by:
again, i know this is OT...just move along to the next post if it bugs you. :) i had been trying to have this: project.66.204.32.110 from the client browser, map to a virtual host where the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.