473,414 Members | 1,692 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,414 software developers and data experts.

Rewrite url to index.php

hsriat
1,654 Expert 1GB
I want that any url other than the ones which end with .css, .js, .ico, .jpg, .png and .gif are sent to index.php
I am using this code for the same, but it's giving 500 Server error.

An idea what can the problem be?
Expand|Select|Wrap|Line Numbers
  1. RewriteEngine On
  2. RewriteBase /
  3. RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ /index.php
Dec 26 '09 #1
2 3673
Dormilich
8,658 Expert Mod 8TB
maybe you don't have mod_rewrite enabled. try to wrap it in the <ifModule> statement.
Dec 26 '09 #2
hsriat
1,654 Expert 1GB
It is enabled as it works if I change the code a little bit.

But anyhow, I managed to get it working with another code:..
Expand|Select|Wrap|Line Numbers
  1. RewriteCond %{REQUEST_FILENAME} !-f
  2. RewriteRule ^(.*)$ index.php [L] 
Thank you very much for looking into the problem.
Dec 27 '09 #3

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

Similar topics

6
by: Steve | last post by:
I'm using a get variable to enable a guest login via a hyperlink. Once I've used it, is there a simple way of rewriting the url to remove ther get details? tia, Steve
10
by: frizzle | last post by:
Hi there. I have a domain, and i want every query string redirected to index.php? so domain.com/foo/bar would actually be domain.com/index.php?/foo/bar Then i want to be able to say in index.php,...
1
by: jbj | last post by:
I am trying to make a javascript function that can rewrite javascript rules dynamically (no, not the style tag of an individual element, but the actual rule in the <head> portion of the document)....
4
by: Stefan Reiter | last post by:
Hi, I got a totally dynamic website, and to improve my search engine results, I would like to use mod rewrite. From what I've understood so far, I have to put the necesarry lines into my...
3
by: kalamantina | last post by:
How to rewrite this snippet if you must implement IDisposable private static void OpenConnection() { string connectionString = GetConnectionString(); StringBuilder errorMessages = new...
5
by: frizzle | last post by:
Hi group, I know this isn't the right group, but i didn't know what group else it should be. I have a php/mySQL system, wich uses mod rewrite to enhance urls. I have the following...
5
by: Lupus | last post by:
Hello everybody In apache I used a feature called a "Rewrite rule" inside a .htaccess file to process the URL : i.e. http://www/mypage.html =http://www/page.php?page=mypage Now I'd like to do...
1
by: Anees | last post by:
hi i was trying to implement mode rewrite option in a blog site. i used the lines for listing the posts by its topic category as #List by Category RewriteRule ^Topics/(+)$ index.php?cat=$1 ...
0
by: andrewteg | last post by:
I have an application that is installed as http://domain.com/folder/ and serves pages as http://domain.com/folder/index.ext/parent/child/ and I'm trying to remove index.ext from the URL so that...
4
chathura86
by: chathura86 | last post by:
hi i placed a .htacess file to rewrite page url e.g RewriteRule index.htmls$ index.php is it possible to get the url parameters with rewrited url
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.