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?
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.
Oh cool, I didn't know that. Do you know of any way to get ASP in windows XP home?
I think you just need to install IIS and it works natively.
The rewrite in .htaccess is very usable, allows you to have DNS Coagulation or something...
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?
What kind of neat things, specifically?
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.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]+
I think my RewriteRule is wrong.
I have a file that works like this:and I want to rewrite the URL to hide the .php and stuff at the end.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>
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... heheCode:Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)\.php?bgcolor=$_GET[bgcolor]&fontColor=$_GET[fontColor] $ $1.php [NC]+
Anyways try this one
So that would beCode:Options +FollowSymlinks RewriteEngine on RewriteRule bg-(.*)-font-(.*)\.html$ test.php?bgcolor=$1&fontColor=$2
That should work.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks