Removing html and php extension


(Monica Sayegh) #1

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!


(Jason Bostick) #2

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


(Monica Sayegh) #3

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


(Jason Bostick) #4

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


(Monica Sayegh) #5

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


(Jason Bostick) #6

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…


(Monica Sayegh) #7

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


(Jason Bostick) #8

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


(Monica Sayegh) #9

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


(Monica Sayegh) #10

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


(kevin olive) #11

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.


(Monica Sayegh) #12

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