Wanted To Convert Php Site To Html......please help friends
Started on the old forum in June 2011 · view the original in the archive · old links redirect here
zong11 wrote: Friends i want to convert my site from php to html. So please tell me how to convert this in to html. I am using sea script.
why would you want to convert from dynamic to static ?
It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!
metulj wrote: why would you want to convert from dynamic to static ?
sounds like he is talking about url rewriting 😀
External image (may be gone) Free Mobile Web Scripts by me: Free Youtube Downloader, Tweets Reader, Facebook Wall Posts Reader PHP Tutorials: [How to Secure Your PHP Script (PHP SECURITY)](http://coding-talk.com/f14/how-to-secure-you…
create a .htacess file
if your link is like index.php?action=action&id=integer
just write
RewriteEngine on
RewriteRule ^/index.php?action=([a-zA-Z0-9\_\-\+]+)&id=([0-9]+) /content/$1/$2.html [L]
RewriteRule ^/index.php?action=([a-zA-Z0-9\_\-\+]+)&id=([0-9]+[\.html]) /content/$1/$2 [l]
RewriteRule ^/index.php?action=([a-zA-Z0-9\_\-\+]+)&id=([0-9]+) /content/$1/$2 [l]
Forgot to flag sorry
This will take alot of time in your project to rewrite everything so its better to
build your site around this
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
RewriteCond %{HTTP_HOST} ^domain.com/ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
when you do this you can get the / poriton of the uri in segments, so the uri will look like this
domain.com/controller/action/param/param
getting individuals parts is ease
function getArguments($uri)
{
$url_array = array();
$uri = trim($uri);
$args = explode("/", $uri);
array_shift($args) // removes first element from array empty
foreach($arg as $a)
{
if(preg_match("/^([a-zA-Z\-\_\+]+)$/", $a))
{
push($a, $url_array);
}
}
return $url_array;
}
then
look at domain.com/controller/action/params
call function
$parts= getArhuments($_SERVER['REQUEST_URI']);
echo "controller:".$parts[0];
echo "action:".$parts[1];
echo "params:".$parts[2];
thats basically it sp u can create ur very own simple MODEL VIEW CONTROLLER FRAMEWORK
No friend not working..... all links are like http://domain.in/index.php?id=1601 and wanted to convert to html.
Always Help Needy Peoples !!!!!
Sorry bro i cant help you anymore just go read up url rewriting
Replace everything in .htaccess with:
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /index.php?id=$1 [L]
than you should be able to access the original URL of http://domain.in/index.php?id=1601 by using http://domain.in/1601.html
