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

.htaccess remove "?page=" – CPanel

I have two questions, both related: Using the example url: https://www.example.com/?page=foo.php How do I use .htaccess to write that out as: https://www.example.com/foo The second part Using the example url: https://www.example.com/?page=directory/bar.php How do I use .htaccess to write that out as:…

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

Htaccess 301 blog redirect url – Apache

I have done 301 redirects on my live site something like from this url https://www.rosterelf.com/support-detail/1424/how-can-i-copy-shifts-from-a-day-to-another to this url https://www.rosterelf.com/support-detail/how-can-i-copy-shifts-from-a-day-to-another and its working fine as per my expectations. Here is my .htaccess code how I made it work. RewriteRule ^(support-detail)/d+/([w-]+)/?$ /$1/$2…

VIEW QUESTION

.htaccess causes redirection – CPanel

Hello there I have 2 folders inside public_html ex.(mainfolder and subfolder). Inside my public_html same level with my 2 folders, I have an .htaccess file like this. RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteOptions inherit Options -Indexes…

VIEW QUESTION

Apache Mod_Rewrite Question Mark

I need to redirect an incoming request with the following URL: http://mywebsite.com/abc/mapserv.exe?map=123 to http://mywebsite.com/abc/mapserv.exe?map=C:Mapserverms4wApachehtdocsMapfiles123.map I already managed to do simple mod_rewrites but the question mark is killing this one all the time. I am not able to adapt common Query…

VIEW QUESTION
Back To Top
Search