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

How to check if a string contains a character or word in php?

0 Answers  


How to redirect a page in php?

0 Answers  


What is php glob?

0 Answers  


Tell me what is the importance of "action" attribute in a html form?

0 Answers  


Explain what does the expression exception::__tostring means?

0 Answers  






What u mean by query?

0 Answers  


What is the difference between apache and tomcat?

0 Answers  


How to remove duplicate values from php array?

0 Answers  


how can i upload only pdf files in my website? files has not a pdf extension mantioned

0 Answers  


Is php 5.6 secure?

0 Answers  


Hello Friends,I am seeking for a job in php having 2yrs. exp.Please suggest any company openings.

1 Answers  


Is null check in php?

0 Answers  


Categories