skip to Main Content

Apache mod_rewrite adding anchor to query string

I'm trying to add an anchor to an URL with a query string. The original URL is https://example.com/foo?query=123 It should redirect to https://example.com/foo?query=123#anchor These are my Rules in the .htaccess file: RewriteCond %{REQUEST_URI} ^/foo$ RewriteCond %{QUERY_STRING} ^query=[a-zA-Z0-9s]*$ RewriteRule (.*) /foo?%{QUERY_STRING}#anchor…

VIEW QUESTION

Pagination URL Structure In Htaccess – Apache

I have a URL Structure as mysite.com/category.php?c=abc&page=4 I need to have a URL Structure as mysite.com/category/abc/page/4 My Htaccess File code for this rewrite looks like this. RewriteEngine On <IfModule mod_rewrite.c> https redirect Rule Here </IfModule> RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php…

VIEW QUESTION
Back To Top
Search