How we can convert dynamic url into static url? plz provide
code.
Answer Posted / 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 View All Answers
How do you create an array in php?
How the result set of mysql be handled in php?
Write a program to swap two numbers using php.
Which is the dependent variable?
What is the use of php and mysql?
How to call a php function from another php file?
How to retrieve values out of an array?
What is php string function?
What is php written in?
Are php session secure?
What does the php error 'parse error in php - unexpected t_variable at line x' means?
Is age a variable in research?
Why ide is recommended for use while programming with php?
What is the major php security hole? How to avoid?
How can you create a session in php?