skip to Main Content

How can I use mutliple url variables? – Apache

I will convert URL's like those example.com/tasks.php?action=list example.com/tasks.php?action=detail&id=48 example.com/tasks.php?action=add&name=Test into those example.com/tasks/list example.com/tasks/detail/48 example.com/tasks/add?name=Test So, I need two variables, but the second must be optional, the file extension must be hidden and I need to add get variables.

VIEW QUESTION

How to write RewriteRules for .htaccess? – Apache

I have a PHP file named as otp.php. When URL in the URL bar is http://localhost/college/otp/MTA=/teacher It should be treated as http://localhost/college/otp.php?user=MTA=&role=teacher For this, I created .htaccess file in http://localhost/college/: RewriteEngine On # Turn on the rewriting engine RewriteRule ^otp/?$…

VIEW QUESTION

Mod Rewrite – Clean URL with query string not working – Apache

I have the following .htaccess file. <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On DirectoryIndex api.php FallbackResource index.php RewriteCond %{REQUEST_URI} ^/api RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{QUERY_STRING} ^$ RewriteRule ^/([^/]+)/([^/]+)$ $1/$1.php?endpoint=$2 [L] RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ $1/$1.php?endpoint=$2&id=$3 [L] RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)$ $1/$1.php?endpoint=$2&id=$3&endpoint2=$4 [L]…

VIEW QUESTION
Back To Top
Search