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]
Related
I have two domains in may server, a.com which is my main domain and a.fr which is my redirect domain.
I like when the user enter http://a.fr/dynamicpath/ automatically going to http://a.com/dynamicpath/, is it possible to accomplish this through htaccess?
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} ^(www\.)?a\.fr$ [NC]
RewriteRule ^ http://a.com%{REQUEST_URI} [R=301,L]
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]
Thanks in advance !! Actually i am suffring from url rewriting problem in php (apache server). Problem is :
I have to write
URL(Old)= abc.com/search_result.php?id=110 to
URL(New)= abc.com/110
it is working in opposite direction when i click the url abc.com/search_result.php?id=110 it does not change to abc.com/110
but when i click the url abc.com/110 it changes to abc.com/search_result.php?id=110
.htaccess code
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^([a-zA-Z0-9]+)$ http://www.abc.com/search_result.php?id=$1
website linnk : [ncrfloors.com][1]
Please anybody help me.....
On your old domain: 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 %{THE_REQUEST} ^[A-Z]{3,}\s/+search_result\.php\?id=([^\s]+) [NC]
RewriteRule ^ http://abc.com/%1? [R=301,L]
I am looking to rewrite all calls to
subdomain.domain.com/video.mp4
to rewrite to
https://s3.amazonaws.com/whatever/video.mp4
How would I do that?
And this is for embedded calls in video players/scripts...
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 ^(.+)$ https://s3.amazonaws.com/whatever/$1 [R=301,L]
Assuming you have a dedicated folder for the subdomain, you would just need the following rule:
RedirectMatch 301 /(.*) https://s3.amazonaws.com/whatever/$1
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^products/([a-zA-Z]+)/([0-9]+)/$ index.php?product=$1&price=$2
This code makes
http://www.example.com/products/computer/1000
into
http://www.example.com/index.php?product=computer&price=1000.
Is it possible to make
http://www.example.com/scriptName/arg1/val1/arg2/val2/arg3/val3
into
http://www.example.com/scriptName.php?arg1=val1&arg2=val2&arg3=val3?
The user should be able to give an unlimited number of arguments. This way one can have /index.php?page=forum&subforum=subforum"e1=postNo1"e2=postNo43 and so on rewrite /index/page/forum/subforum/subforum/quote1/postNo1/quote2/postNo43
How would the .htaccess code look?
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 ^([^/]+)/([^/]+)/([^/]+)(.*?)/?$ $1/$4?$2=$3 [L,QSA]
RewriteRule ^([^/]+)/$ $1.php [L]
This will forward a URI of /scriptName/arg1/val1/arg2/val2/arg3/val3 to /scriptName.php?arg3=val3&arg2=val2&arg1=val1