Forum Moderators: phranque
I basically want to make friendly URL's. As I understand it I need to save my php files as html and tell the server to parse them as php. Something like:
RewriteRule ^([a-z]+)\.html$ /index.php?$1 [R,L]?
But I also need to replace part of the string like:
(?sortfield=&sortby=&search_fd3=) with a simple dash of slash. Is this all possible with htaccess or should I start over and get a server with root access?
I know this is becoming more and more important with the SE's and I'd like to get it right. Any help is much appreciated. Thanks.
AddType application/x-httpd-php .php .html
The difference between httpd.conf and .htaccess is one of power and scope. The documentation for each Apache directive states where it can be used, and some are restricted (for security and administration reasons) to httpd.conf. Also, further restrictions can be configured in httpd.conf to enable or disable procesing of certain directives in .htaccess.
You can solve the current problem as stated above. If you run into a problem that cannot be solved in .htaccess, you could ask the hosting provider to change your httpd.conf for you. Some will do this, and some won't, so you may want to inquire now, just to be sure.
Jim
From what I've been reading, if I'm understanding it right, the header information is first sent to the server where it is read by the httpd.conf and than translated into its filename. If you use .htaccess the request must go to the server than to the .htaccess file and back to the server to be read again. Of course this all only takes a split second but on a large site with a lot of URL manipulation wouldn't this be a potential problem?
If you're getting 100,000 uniques per day, then there might be some impact. Below that, I doubt it.
Jim