linux - htaccess redirect to subdomain and keep string -


found few similar questions either cant figure out answers or dont directly match needs.

what trying achieve this:

i moved part of site sub domain on different server used in: http://mysite.com/clients on http://clients.mysite.com

using: redirectmatch 301 https?://mysite.com/clients/^(.*)$ https://clients.mysite.com/$1 works fine redirecting people hitting http://mysite.com/clients new sub domain able preserve string after /clients/

so if hits e.g. http://mysite.com/clients/could_be_a_number_of_things.php redirects http://clients.mysite.com/could_be_a_number_of_things.php

can advise?

full .htaccess requested:

    # -frontpage-  indexignore .htaccess */.??* *~ *# */header* */readme* */_vti*  <limit post> order deny,allow deny allow </limit> <limit put delete> order deny,allow deny </limit> #authname mysite.com #authuserfile /home/inhost/public_html/_vti_pvt/service.pwd #authgroupfile /home/inhost/public_html/_vti_pvt/service.grp  # begin wordpress options +followsymlinks -multiviews <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] rewritecond %{https}s on(s)| rewritecond %{http_host} ^(www\.)?mysite\.com$ rewriterule ^clients/(.*)$ http%1://clients.mysite.com/$1 [l,nc,r=301] </ifmodule>  # end wordpress 

enable mod_rewrite , .htaccess through httpd.conf , put code in .htaccess under document_root directory on mysite.com server:

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase /  rewritecond %{https}s on(s)| rewritecond %{http_host} ^(www\.)?mysite\.com$ rewriterule ^clients/(.*)$ http%1://clients.mysite.com/$1 [l,nc,r=301] 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -