|
#1
|
|||
|
|||
|
How to do a mod_rewrite so that my php pages will be seen as .html pages?
|
|
#2
|
|||
|
|||
|
Would it be something like this?:
Code:
Options +FollowSymLinks RewriteEngine on RewriteRule index.html$ /index.php? |
|
#3
|
|||
|
|||
|
I think what you want it to have php code inside of your html pages, that way you don't have to have people see .php. This is possible with this .htaccess code:
Code:
AddHandler application/x-httpd-php5 .htm .html |
|
#4
|
|||
|
|||
|
Quote:
Code:
#AddHandler application/x-httpd-php5 .php Code:
#AddHandler application/x-httpd-php5 .php .htm .html |
|
#5
|
||||
|
||||
|
Change it to that, and take off the # from the beginning (the # means it's commented out).
If that breaks your site, use this instead: Code:
AddHandler application/x-httpd-php5 .php .htm .html
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#6
|
|||
|
|||
|
Ok Thanks!
|
|
#7
|
|||
|
|||
|
Does it really matter that they are .php instead of .html files though?
|
|
#8
|
|||
|
|||
|
Well they say that .html is more seo friendly, search engines follow .html better.
|
|
#9
|
||||
|
||||
|
Who is they?
__________________
- David |
|
#10
|
|||
|
|||
|
Generally speaking... what I've read. Is it not true?
|
|
#11
|
||||
|
||||
|
Not in my experience.
__________________
- David |
|
#12
|
|||
|
|||
|
The search engines that matter (Google, Yahoo, etc) follow php pages just fine. I don't recommend handling .php pages through the .html extension unless you have a serious need to do so; adding the php handler to your .htm(l) pages means more cpu use for your account (since the php handler would be called on basically every page, regardless of whether or not it had php code in it).
They do not deal with dynamic content as well, depending on how it's done. However, the fact that your page ends in .html or .php does not matter if it uses URIs like: http://website.com/page.php?id=12345...nline=whatever (not engine friendly) vs: http://website.com/page.php/item_hammer/online/ You get the idea. The page extension is not the problem. Now, you could probably rewrite URLs from the first example to the 2nd, but it's a bit of work to do something like that. |
|
#13
|
|||
|
|||
|
Thanks for that tutorial Jamyn.
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
All times are GMT -5. The time now is 03:36 PM.









