Removing html and php extension

Hi, I know my question has been asked before by someone else and has been answered before by, but I am clear how to fix it.

How can I remove the html and php from the url (extension) eg:

from: www.mysite.com/index.html to: www.mysite.com
from: www.mysite.com/contat-us.php to: www.mysite.com/contact-us

Thank you!

If you enable the ‘Tidy Links’ setting in your Rapidweaver preferences it will do that but only for files that are named either index.php or index.html, it won’t work for contact-us.php

In those instances, you’d want to name the folder contact-us and the file index.php (or index.html)

Oh, and to get to that, go to the page sidebar and General Settings, then click the little ‘Advanced’ button in the bottom right of that window

2 Likes

@jabostick, thanks for your reply, I’ve just tried that and it did give me
File not found (404 error)

What did you try and which URL gave you the error?

www.mysite.com/about-us.php (as about us has a form to collect data.
please see the snapshot what I have entered.

so your new address would be www.mysite.com/about_us (without the .php you have above).

You may need to do a Republish all files after enabling the tidy links setting, I’m not sure…

done all that, still error… I will try again!

Or it could be caching as well. If you use cloudflare, for example, remember to put it in Developer Mode, or purge the files.

@jabostick apology but I am not sure how to do that!. I will keep trying! thanks.

@jabostick just to let you know, it worked (cleared the browser cache) and voilà!

1 Like

While it probably isn’t required to keep it working, you may also want to delete the old files from the web server. RW doesn’t delete files when publishing so it is up to you to clean up the old stuff. I’ve run into problems when adding a stack to a page that switches it from html to php and then it is ambiguous as to which file should load when both index.html and index.php are in the directory.

@kevino Thanks Kevino, actually I did that after learning that RW does not delete all files.