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 data structure in php?

0 Answers  


Who is the father of PHP and explain the changes in PHP versions?

13 Answers   Befree, iMark Group, Netizen,


List some features of php that are deprecated in php7?

0 Answers  


Is php class name case sensitive?

0 Answers  


How do you check if a variable has been set in php?

0 Answers  






How do I install php?

0 Answers  


When you will get the error "Cannot add header information"?

2 Answers  


How do you parse and process html/xml in php?

0 Answers  


What are new features in php 7?

0 Answers  


How do you use bcrypt for hashing passwords in php?

0 Answers  


Is php 7.0 stable?

0 Answers  


List out different arguments in PHP header function?

4 Answers  


Categories