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.

1
  • 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. Commented Nov 28, 2012 at 16:26

3 Answers 3

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]
Sign up to request clarification or add additional context in comments.

Comments

2

This'll do the trick:

RewriteEngine On    # Turnon the rewriting engine
RewriteRule ^/index\.php$ - [L]
RewriteRule    .    url.php    [NC,L] 

1 Comment

And I believe this should be put before the existing RewriteRule the OP has.
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.