#Hide Index
IndexIgnore *
#Define ErrorDoc
ErrorDocument 404 http://www.domain.com
#REDIRECTS
Redirect 301 /page.php http://domain.com
Redirect 301 /inc/page.php http://domain.com
Options +FollowSymlinks
RewriteEngine on
#Redirect all pages in a folder to a single URL
RewriteRule ^dir/(.*)$ http://domain.com/index.php [L,R=301]
#Redirect String
RewriteRule ^index.php?var1=value&var2=(.*)
I have the following on my .htaccess file within /var/www/html folder.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.net [nc,or]
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com\.au [nc,or]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent, NC, L]
I want all domain.net and domain.com.au requests to redirect to domain.com.
what is the best possible way to redirect and rewrite url in virtual host file?
I want to make sure it is not heavy on the server.
I tried many ways on the virtualhost file but when I restart the apache it fails. I dont want to use .htaccess...
I am trying to redirect only my top level domain eg. domain.com to sub.domain.com.
I'm trying to get a simple www. to non www. redirect set up.
I have to write a redirect rule for the below condition.
www.domain.com/custom.aspx?ATTR=VALUE to
www.domain.com/custom?ATTR=VALUE
How can this be achieved using the .htaccess
I have the below set of codes using on the current .htaccess file. Please also suggest where to include your code.
So I have oldwebsite.com/forums/seo-topics-here and I need to redirect to newsub.newsite.tld/seo-topics-here
Can I do this with htaccess
Does something like this work?
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.forums.mydomain.com
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
I'm trying to write a custom redirect rule for some testing purposes on 2 domains with exactly same site. The code Im useing is:
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$
RewriteCond %{HTTP_HOST} ^.*site1.com [NC]
RewriteRule ^(.*)$ http://www.site2.com/$1 [R=301,L]
What I want is to redirect all requests except 1.2.3.4 IP from site1 to site2.
My website is built up like the following
www.domain.com/products/catname/myproduct.php
www.domain.com/products/myproduct.php
Some files are in deeper directories. I am wanting to redirect www.domain.com/products/catname/ (for example) to a certain page. My directories do not include index files.