skip to Main Content

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

URLs rewrite using regex pattern – Apache

I need to rewrite URL's using .htaccess to redirect all users from old sitemap to the new URL's. The old URLs looks like this: http://server.linux.example.com/a/v/c/document_title1.php http://server.linux.example.com/jp/x/1/o/document_title32.php http://server.linux.example.com/kr/a/a/2/document_title12343.php http://server.linux.example.com/cn/6/z/z/document_title124.php I need to keep first directory and then remove all sub-directories, including…

VIEW QUESTION
Back To Top
Search