Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my first attemp at creating clean URLs using a .htaccess file.

My page is a simple, php generated page.

My page is

On the top left corner of the page I have a link, pointing to

To redirect I use this .htaccess file:

RewriteEngine On
RewriteRule ^arxiki$ index.php
RewriteRule ^arxiki/$ index.php

It is my understanding that weather I go to or I should be getting the same page. That is not the case.

Any explanations / things I am doing wrong?

Sorry I am not posting links and making you type the address, but since my rep is only 3, the site limits my amount of hyperlinks per post to 2.

share|improve this question
What do you get instead of the same page? – Shane Madden Jan 27 '12 at 5:16
up vote 2 down vote accepted

The rewrite and the page are both working fine. The problem is that with a trailing slash, your browser tries to grab the stylesheet from /arxiki/views/style.css which doesn't exist. Without the trailing slash, the stylesheet comes from /views/style.css.

If you change your stylesheet link in your source code to /views/style.css instead of views/style.css, the styles will be applied correctly.

You could probably have identified this from your Apache error logs as you would have seen a lot of "File not found" errors complaining about /arxiki/views/style.css.

You can also combine both your rewrite rules into one like this:

RewriteRule ^arxiki/?$ index.php

The question mark means "0 or 1 of the preceding character".

share|improve this answer
It is my understanding there are a number of different regex evaluations, depending on programming language. Which one does apache use in the .htaccess file? – ppp Jan 27 '12 at 12:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.