1

I have a webpage: http://www.somename.com/webapp.php

I'd like users to be able to get to it be simply typing http://www.somename.com/webapp

I know this would work if the page was an html page ('webapp.html').

Any ideas on how I can make this work? Is there a configuration file I can edit to get the desired behavior?

I have two ideas, but they seem clunky to me:
1) make a webapp.html and have it redirect to webapp.php
2) make webapp.html and iframe webapp.php inside of it

Thanks!

3 Answers 3

3

If you are using Apache with mod_rewrite, you can add these lines to your .htaccess

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [L]

This will map hostname.com/webstore to hostname.com/webstore.php

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

1 Comment

You probably want to check that it's not an existing directory, either.
3

Easy solution: Make a folder webapp/, move your script there and rename it index.php ;-)

1 Comment

I tried this and it worked - it actually made sense to go this route for other reasons too. Thanks!
2

Put this in your .htaccess file:

Options +MultiViews

This will turn on content negotiation and automatically look for a matching file when no extension is given.

2 Comments

Um... if you're using Apache, that is.
I tried this, but it didn't work. It's on my to-do list to contact godaddy and find out why. Thanks.

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.