2

I want to rewrite this url

http://localhost/vector-svn/demo.php

rewrite to

http://localhost/vector-svn/demo

my .htaccess file code

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.$ $1.php [nc]

any kind help would be appreciated ?

1
  • 1
    That RewriteRule looks ok to me. Do you have mod_rewrite.c actually enabled? Commented May 2, 2011 at 6:22

3 Answers 3

2

Answer to my own question !! This works for url rewriting !!

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
Sign up to request clarification or add additional context in comments.

Comments

0

You could do this:

rewriteRule ^(.*)$ $1.php [NC]

Edit: I see your rewrite rule is exactly the same. What problem do you have?

1 Comment

You could try this: rewriteRule ^(.*)\/$ $1.php [NC]
0

Sounds like mod_rewrite is not installed at all. Check apache documentation, link.

Sorry, brief answer... this link might also help you out, could be a few things and as mentioned the rewrite looks fine, so try and see if any of the following work.

http://www.wallpaperama.com/forums/how-to-fix-mod-rewrite-500-internal-server-error-on-htaccess-file-apache-t718.html

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.