How we can convert dynamic url into static url? plz provide
code.

Answers were Sorted based on User's Feedback



How we can convert dynamic url into static url? plz provide code...

Answer / sun

Save the page as .html and not .php!

simple as that!

Is This Answer Correct ?    14 Yes 1 No

How we can convert dynamic url into static url? plz provide code...

Answer / udit rawat

Add an .htaccess file(if using apache)

# Turn on URL rewriting
RewriteEngine On

RewriteBase /

# Allow any files or directories that exist to be displayed
directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]
This redirects all urls to index.php. index.php will be some
sort of front controller that loads scripts based on the url

So in your example:

localhost/mywebsite/mypage

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More PHP Interview Questions

What is the difference between htmlentities() and htmlspecialchars()?

0 Answers  


Do you know what is php?

0 Answers  


What is regex in html?

0 Answers  


How can you declare a constant variable in php?

0 Answers  


What are html entities?

0 Answers  






1.Where are the sessions storing ? 2.What are the contents of a session file ? 3.If the server is loaded with too many session files there is a possibility of server crash. How can we solve this issue? 4. How does php server identify that the particular session belongs to particular user ? For ex: If two users A and B logged from different machine, separate session files (say 1 and 2) will be created in the server. But how the php knows that 1 belongs to A and 2 belongs to B ?

4 Answers   PA Consulting, TCS,


Write a program in php to print a table of a number?

0 Answers  


What is the importance of "method" attribute in a html form?

0 Answers  


What is php and features of php?

0 Answers  


Is php session id unique?

0 Answers  


Declare a new variable in php equal to the number 3;

0 Answers  


Does php support multiple inheritances?

0 Answers  


Categories