0

I have a problem trying to hide .php extension from the url

I have been asked to hide it and because they are on a shared host i don't think i have access to .htacess so is there another way to hide it through a php function that i would call everytime an anchor is being selected?

1
  • You are not sure you can use a htaccess? Why don't you try? Commented Apr 5, 2012 at 18:50

2 Answers 2

1

Is this truly about hiding .php or is it more about having cleaner URLs?

If you truly can't access .htaccess (i.e. your host has this turned off via AllowOverride None) and assuming you also can't have your Apache conf settings updated for your VHost, the best you can do may be

http://example.com/page.php/my/clean/url

By default, Apache will send this URL to page.php even with everything else after it. This is the most common way of creating "cleaner" URLs without access to mod_rewrite.

Sign up to request clarification or add additional context in comments.

Comments

0

.htaccess is what you would have access to on a shared server, as opposed to httpd.conf, which you wouldn't.

Put a .htaccess file in your document root with the following

FAIL

If your site stops loading, then you can use .htaccess :)

Of course, ^ that is a joke.

1 Comment

Was it a joke? I actually employ this technique from time to time to check if AllowOverride is All, although I generally write more obscure stuff :P

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.