0

I am very new to mod rewrite so any help would be apprecited.

let say i have a site named "www.sitename.com/index.php?p=contact" and i need to remove "index.php?p=" so that it will look like "www.sitename/contact" at its every occurence that means either i should be able to truncate "index.php?p=" or i should be able to replace it with some word.

1
  • smarty tag, as well as php, has nothing to do with this question. also you could add mod-rewrite tag Commented Sep 23, 2010 at 1:16

2 Answers 2

1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php?p=$1
Sign up to request clarification or add additional context in comments.

Comments

0

@zerkms Your answer doesn't work, it's not complete

There should be

RewriteCond %{REQUEST_URI} ^/[^.]+$
RewriteRule (.*) index.php?p=$1

These lines matches URI with no extension, so .php and .html files will still be available

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.