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

Write a program using while loop in php?

0 Answers  


How to select a database in php?

0 Answers  


How do I run a php file?

0 Answers  


What is the scope of a variable defined in a function?

0 Answers  


Write a program to find no of days between two dates in php?

0 Answers  






How does php strcmp work?

0 Answers  


What is the basic function to search files for lines (or other units of text) that contain a pattern.

0 Answers  


Do you know when sessions ends?

0 Answers  


why we use @symbol before the variable

5 Answers   HCL, Numark,


How to read a file in php?

0 Answers  


What is the difference server side and browser side validation?

0 Answers  


Do you know what is the difference between mysql_fetch_object() and mysql_fetch_array()?

0 Answers  


Categories