We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29073
    • 9 Posts
    Web Server:
    PHP5, MySQL5, Linux and Apache with mod_rewrite

    MODx:
    modx 0.9.6.1

    I have tried to point the url to say http://www.visionmountain.com/index.php, but I don’t know how to do that in .htaccess.
    When I type in visionmountain.com in the address bar, it is always go to http://www.visionmountain.com which is the same as http://www.visionmountain.com/index.html. How do I change it to point to /index.php?
    Thank you for your help,
    Ying
      Ying
      -------------------
      Web Designer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      In Tools -> Configuration, the Friendly URLs tab, edit the suffix to whatever you want. By default, the suffix is .html, so if you really want it to say .php, put that there instead. Is there a particular reason why you want it to say .php? Usually it’s preferable not to advertise what kind (if any) of scripting you’re using.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 15152
        • 360 Posts
        Sylph
        Is there any reason you want the index.html page on the site? Just download and save it to your desktop. Then delete it from the server. Your site will default to index.php - or whatever page you designate as the home page. If you keep the index.html page anyone going to vistamountain.com will automatically go there. index.html will trump all other files and show up as the default if you don’t remove it.
          There are no boring projects. Only boring executions. ~ Etzkorn
          www.impress-design.com
          • 29073
          • 9 Posts
          Quote from: sottwell at Feb 17, 2008, 11:46 PM

          In Tools -> Configuration, the Friendly URLs tab, edit the suffix to whatever you want. By default, the suffix is .html, so if you really want it to say .php, put that there instead. Is there a particular reason why you want it to say .php? Usually it’s preferable not to advertise what kind (if any) of scripting you’re using.

          I changed it to .php but it is still not working. I had my old files in .html, and they were not from CMS. I created all the pages in dreamweaver. However, I am replacing it with the pages from CMS. I just remove all the pages that I create in dreamweaver to a folder, and my website is not even showing anymore. It said "403 Forbidden
          You don’t have permission to access / on this server.

          Apache/1.3.33 Server at www.visionmountain.com Port 80"
          I am not sure why it is like that...
            Ying
            -------------------
            Web Designer
            • 29073
            • 9 Posts
            Thank you for the help, it finally shows the pages now. laugh
              Ying
              -------------------
              Web Designer
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Actually that’s a server configuration issue; Apache (and other web servers) have an option to set what pages will take precedence. The default is "index.html" or "index.htm", then "index.php". So if you have an index.html document in the same folder as an index.php file, the index.html file will always be used.

              My advice on changing the suffix for the friendly url alias was a misunderstanding of your question.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 7231
                • 4,205 Posts
                I had this issue recently. I substituted an index.html with an index.php and althoug some people were directed to the correct php file others insisted on looking for the html file. I suspect that it is related to ISPs using server caches to speed up services to try to keep up with broad band. I know nothing about how ISPs work so this is just a guess smiley

                I will try to avoid this in the future with some planing.

                Anyway, good it is resolved.
                  [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                  Something is happening here, but you don't know what it is.
                  Do you, Mr. Jones? - [bob dylan]
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Could have been browser bookmarks, or even old search engine urls specifically using the index.html in the URL.

                  I did have one ISP with a badly configured proxy cache that wouldn’t show any changes at all for 24 hours. They refused to acknowledge a problem, but I happened to still have an old dial-up account with a different ISP that worked perfectly. Same site, same computer, just a different ISP.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 29073
                    • 9 Posts
                    When you told me to change Tools Configuration, I saw the friendly URL. I was wondering why my pages was showing like /index.php?id=1. However, I couldn’t figure out how to use it. it always says "The requested URL The requested URL /index.html was not found on this server." I have changed the .htaccess RewriteBase to point to the root of the server, but it is still not working. I guess it is too much to learn for a designer... :’( But I am almost there. This is my first project, maybe the next one will be better.
                      Ying
                      -------------------
                      Web Designer
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      First, you need to do as you said, make sure the RewriteBase points to your MODx root. For example, on a remote live site it will most likely be just / to indicate the web root, while on my local dev sites they would be /0962 and /097-a, or /clientname for an installation for developing for a client.

                      Then you need to rename them to .htaccess. I always copy them and rename the copy so that I don’t accidentally lose the original. OS X Finder won’t let me save "hidden" files like that, so I have to use the terminal and do a "cp ht.access .htaccess" at the command line. Via FTP I duplicate the file with the new name. You also need to rename or copy and rename the one in the /manager folder; that turns off the rewrite engine for manager pages.

                      Then turn on Friendly URLs.

                      It’s also possible you may need to uncomment the line above the "rewrite engine on" line to have the server follow symlinks. Some hosts require this, some don’t, and some have it set already in the server configuration. My remote virual private server requires it, which I discovered the hard way when I first set it up, and the results of the research I did is that the line is now in the ht.access file in case somebody needs it. It doesn’t hurt to have it uncommented even if you don’t need it, but there’s no point in making the server parse it if it isn’t necessary. On the other hand, the server does tend to behave erratically if you have the rewrite engine turned on more than once, so it’s a good idea to make sure you don’t have an .htaccess files "upstream" of your MODx installation already turning it on.
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org