htaccess redirect to another folder - .htaccess

I have to redirect using htaccess.Please help me.
From this
URL :- http://xxx/CCKCHT/
to redirect it
URL :- http://xxx/CCKCHT/lhc_web/index.php/site_admin/

Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /CCKCHT/
RewriteRule (?!^lhc_web/index\.php/site_admin/)^(.*)$ /CCKCHT/lhc_web/index.php/site_admin/$1 [L,R=301,NC]

Related

.htaccess url aliasing for /r/var to #/r/var

I've tried going through the documentation for this but I'm definitely no sys admin. I'd like to create a ReWrite rule for my domain alienstream.com, so that alienstream.com/r/electronicmusic is aliased to alienstream.com/#r/electronicmusic
I know what the general form is going to follow
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/([a-zA-Z0-9]+)$ /#/?var=$1 [L]
</IfModule>
but I just don't understand the syntax for this
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteRule ^(r/.+?)/?$ /?sub=$1 [NC,L,R]

htaccess Sub Dir redirect

Is there anyway for me to redirect my subdomain index to my main domain?
From Subdomain.Domain.com/index or Domain.com/SubDomainFolder/index to just Domain.com
Tried several methods from StackOverflow, but yet nothing seems to take effect. Thank you
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:subdomain\.)?(domain\.com)$ [NC]
RewriteRule ^(?:SubDomainFolder/|)(index)/?$ http://%1/? [L,R,NC]

.htaccess remove pattern from url

is there any way to remove some pattern from url?
For exampple this is my pattern -=-something_dynamic-=-
and here is my url
_http://mysite.com/category/-=-something_dynamic-=-subcategory/
that I wish to become
_http://mysite.com/category/subcategory/
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(category)/.*?(subcategory)/?$ /$1/$2/ [L,NC,NE,R=301]

htaccess rewrite to change gif urls

I hope you can help.
I'm trying to do a htaccess rewrite changing
file.gif to images/file.gif
I'm waded through this site, but can't find it. Any help would be much appreciated.
Thanks
Mark
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule (?!^images/)^([^.]+\.gif)$ /images/$1 [L,NC]

url rewriting in php using .htaccess

I need to rewrite the url in my project.
I have a url like this
http://www.example.com/apps?platform=Android&category=Business&keyword=cows
and i need to rewrite this to http://www.example.com/apps/Android-Business-cows
How can i implement this url rewrite
I am cakephp framework in php.
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(apps)/([^-]+)-([^-]+)-([^-]+)/?$ $1?platform=$2&category=$3&keyword=$4 [QSA,L,NC]
This will do (asuming you're using mod-rewrite on apache):
RewriteEngine ON
Options +FollowSymLinks -Multiviews
RewriteRule ^apps/([^-]+)-([^-]+)-([^-]+)$ apps?platform=$1&category=$2&keyword=$3

Resources