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
-
☆ 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.
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
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
Thank you for the help, it finally shows the pages now.
Ying
-------------------
Web Designer
-
☆ 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.
-
☆ 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.
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
-
☆ 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.