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

Does php support function overloading?

0 Answers  


What is the difference between array_merge() and array_merge_recursive() in php?

0 Answers  


What is php compared to html?

0 Answers  


when we submit any string in single inverted comma('abc') with get or post method,we will get exact string with single inverted comma('abc')by using $_REQUEST[]. But it is giving (\'abc\'). so anybody please help me to remove that slash,therefore i will get exact string...

2 Answers  


which function used to get the number of days between two given dates in php

1 Answers  


Is php worth learning in 2019?

0 Answers  


Tell me how is it possible to return a value from a function?

0 Answers  


Tell me how to create a session? How to set a value in session? How to remove data from a session?

0 Answers  


Is php front end or back end?

0 Answers  


What is htmlentities function in php?

0 Answers  


Do I need to install php after xampp?

0 Answers  


What does echo mean in php?

0 Answers  


Categories