8
RewriteEngine On    # Turn on the rewriting engine
RewriteRule    .    url.php    [NC,L]    

I'm redirecting all the requests to url.php but I want to leave index.php as is.

xlecoustillier
  • 16,183
  • 14
  • 60
  • 85
kajab
  • 135
  • 1
  • 9
  • All endline comments generate errors and will fill up the error logs with warnings. Do not place comments at the end of any directive or any line. This change happened in Apache 1.3.x put comments on their own line. – kittycat Nov 28 '12 at 16:26

3 Answers3

7
# Turn On ReWrite Engine
RewriteEngine On

# Exclude url.php and index.php from redirecting
RewriteCond %{REQUEST_URI} !^/(index|url)\.php

# Redirect to url.php
RewriteRule . url.php [NC,L]
kittycat
  • 14,983
  • 9
  • 55
  • 80
2

This'll do the trick:

RewriteEngine On    # Turnon the rewriting engine
RewriteRule ^/index\.php$ - [L]
RewriteRule    .    url.php    [NC,L] 
Ronn0
  • 2,249
  • 2
  • 21
  • 36
0

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator and inform them of the time the error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

nathan
  • 149
  • 1
  • 1
  • 10