Closed Thread
Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 46

Thread: .html or not?

  1. #21
    Join Date
    Mar 2008
    Posts
    7,145
    Rep Power
    86

    Re: .html or not?

    Yes, .html is better for SEO but if your using PHP on your page, don't you have to use .php or .php5 for the PHP to work?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #22
    Jordan Guest

    Re: .html or not?

    No. You can setup in your apache configuration file to use .html, .asp or anything for PHP files (you just tell it what extension is used to execute PHP). But, a better way to do it is to use .htaccess and the rewrite mod. If you notice the URL for this thread ends in .html but it is actually a PHP script.

  4. #23
    Join Date
    Mar 2008
    Posts
    7,145
    Rep Power
    86

    Re: .html or not?

    Oh cool, I didn't know that. Do you know of any way to get ASP in windows XP home?

  5. #24
    Jordan Guest

    Re: .html or not?

    I think you just need to install IIS and it works natively.

  6. #25
    Sionofdarkness is offline Programming Expert
    Join Date
    Jul 2006
    Posts
    383
    Rep Power
    0

    Re: .html or not?

    The rewrite in .htaccess is very usable, allows you to have DNS Coagulation or something...

  7. #26
    Join Date
    Mar 2008
    Posts
    7,145
    Rep Power
    86

    Re: .html or not?

    I got some neat things in my .htaccess but when I try to use mod rewrite I get an internal server error.

    Does anybody know why?

  8. #27
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101

    Re: .html or not?

    Would you mind posting your .htaccess content?

  9. #28
    Kaabi Guest

    Re: .html or not?

    What kind of neat things, specifically?

  10. #29
    Join Date
    Mar 2008
    Posts
    7,145
    Rep Power
    86

    Re: .html or not?

    Code:
    ErrorDocument 400 /errors/400.html 
    ErrorDocument 401 /errors/401.html 
    ErrorDocument 403 /errors/403.html 
    ErrorDocument 404 /errors/404.html 
    
    
    AddType text/html .shtml 
    AddHandler server-parsed .shtml
    Options Indexes FollowSymLinks Includes
    DirectoryIndex index.shtml index.html
    
    
    order allow,deny
    deny from 123.45.6.7
    deny from 012.34.5.
    allow from all
    
    Redirect /docs/old/index.html http://localhost/docs/php/test.php  
    
    AddType application/x-shockwave-flash swf
    AddType application/octet-stream txt 
    
    IndexIgnore *.gif *.jpg *.css *.js 
    
    <ifModule mod_php4.c>
     php_value zlib.output_compression 16386
    </ifModule>
    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^(.*)\.php?bgcolor=$_GET[bgcolor]&fontColor=$_GET[fontColor] $ $1.php [NC]+
    Well I find the applicaton/octed-stream thing pretty interesting and the enabling SSI interesting. I don't know much about programming so all this really interested.

    I think my RewriteRule is wrong.

    I have a file that works like this:
    Code:
    http://localhost/docs/test.php?bgcolor=green&fontColor=red
    
    <html>
    <head>
    <title></title>
    </head>
    <body bgcolor="<?php echo $_GET['bgcolor']; ?>">
    <font color="<?php echo $_GET['fontColor']; ?>">
    Text</font>
    </body>
    </html>
    and I want to rewrite the URL to hide the .php and stuff at the end.

  11. #30
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^(.*)\.php?bgcolor=$_GET[bgcolor]&fontColor=$_GET[fontColor] $ $1.php [NC]+
    Yeah that is completely wrong, idk what is the final url that you want... that string is so confusing. You tried adding PHP to .htaccess... hehe

    Anyways try this one

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule bg-(.*)-font-(.*)\.html$ test.php?bgcolor=$1&fontColor=$2
    So that would be

    That should work.

Closed Thread
Page 3 of 5 FirstFirst 12345 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. html
    By edwin namisi in forum HTML Programming
    Replies: 11
    Last Post: 06-14-2010, 02:40 PM
  2. Replies: 5
    Last Post: 02-02-2009, 10:58 AM
  3. Which one - PHP or Html?
    By Kolyn_Kryw in forum PHP Development
    Replies: 18
    Last Post: 06-14-2008, 01:47 PM
  4. C++ to HTML?
    By The Midnighter in forum C and C++
    Replies: 14
    Last Post: 11-13-2007, 09:26 AM
  5. HTML Help
    By Selena777 in forum General Programming
    Replies: 3
    Last Post: 05-22-2007, 03:52 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts