I have the following htaccess file for my ZF project.
SetEnv APPLICATION_ENV production
# Redirect old site pages
redirect 301 /The_GAPS_Postal_Application_20110126.pdf /pdf/The_GAPS_Postal_Application_20110126.pdf
redirect 301 /The_GAPS_Constitution.pdf /pdf/The_GAPS_Constitution.pdf
redirect 301 /The_GAPS_EJ_Postal_Application_20110126.pdf /pdf/The_GAPS_EJ_Postal_Application_20110126.pdf
redirect 301 /The_GAPS_Fishery_Rules.pdf /pdf/The_GAPS_Fishery_Rules.pdf
redirect 301 "/Gipping Angling and Preservation Society Waters.pdf" /pdf/Gipping_Angling_Preservation_Society_Waters.pdf
redirect 301 /gaps_waters.php /waters
redirect 301 /alderson_lakes.php /waters/alderson-lakes
redirect 301 /barham_b_pit.php /waters/barham-b-pit
redirect 301 /causeway_lakes.php /waters/causeway-lakes
redirect 301 /perch_pit.php /waters/perch-pit
redirect 301 /river_gipping_barham.php /waters/river-gipping-barham
redirect 301 /river_gipping_bramford.php /waters/river-gipping-bramford
redirect 301 /river_gipping_elton_water_bank.php /waters/river-gipping-elton-water-bank
redirect 301 /river_gipping_lagoon.php /waters/river-gipping-shamford-lagoon
redirect 301 /river_gipping_shamford_lock.php /waters/river-gipping-shamford-lock
redirect 301 /river_gipping_sproughton.php /waters/river-gipping-sproughton
redirect 301 /gaps_maps.php /waters/maps
redirect 301 /gaps_rules.php /waters/rules
redirect 301 /joining_gaps.php /membership
redirect 301 /gaps_postal_applications.php /membership/postal-applications
redirect 301 /joining_gaps_early.php /membership/join-early
redirect 301 /joining_caps.php /membership/join-caps
redirect 301 /gaps_guest_permits.php /membership/guest-permits
redirect 301 /gaps_officers.php /officers
redirect 301 /gaps_match_fixtures.php /matches/fixtures
redirect 301 /downloads.php /downloads
redirect 301 /links.php /links
redirect 301 /gaps_work_parties.php /work-parties
redirect 301 /constitution.php /constitution
RewriteEngine On
# Cached files
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{DOCUMENT_ROOT}/cached/index.html -f
RewriteRule ^/*$ cached/index.html [L]
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{DOCUMENT_ROOT}/cached/%{REQUEST_URI}\.html -f
RewriteRule .* cached/%{REQUEST_URI}\.html [L]
# Route to index.php for ZF
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
# Add compression
AddOutputFilterByType DEFLATE text/html
In my public_html folder I have a subfolder called lists containing a third party newsletter application. However calls to this folder just get redirected to the ZF application.
My question is how do I get the files in the lists folder to pass straight through rather than being directed to the ZF application?
Related
Good afternoon,
I have the following structure on a multi-language website made with Prestashop with Apache server(I have access to htacces, Cpanel), is currently indexed in Google:
domain.es/es/
domain.es/pt/
domain.es/fr/
domain.es/de/
domain.es/en/
Now we want to go on to use Multistore to be able to have a better management in each country, therefore we want to create a subdomain for each country, in this aspect we know how to do it, but we are faced with the question of redirects of already indexed content.
We believe that the best way would be to use a domain.com with a subdomain of each country and dispense with the languages, leaving only the default language of each country, therefore we would eliminate /es/, /pt/, /fr/, etc.
Our domain.es/es/ is the one that is most positioned, would it be advisable to keep this and modify the other languages with domain.com? or is it indifferent and it would be better to structure everything with domain.con and its subdomains?
Option 1:
domain.es/es/allpages --redirect 301 to--> domain.es/allpages
domain.es/pt/allpages --redirect 301 to--> pt.newdomain.com/allpages
domain.es/de/allpages --redirect 301 to--> de.newdomain.com/allpages
domain.es/fr/allpages --redirect 301 to--> fr.newdomain.com/allpages
domain.es/en/allpages --redirect 301 to--> eu.newdomain.com/allpages
Option 2:
domain.es/es/allpages --redirect 301 to--> es.newdomain.com/allpages
domain.es/pt/allpages --redirect 301 to--> pt.newdomain.com/allpages
domain.es/de/allpages --redirect 301 to--> de.newdomain.com/allpages
domain.es/fr/allpages --redirect 301 to--> fr.newdomain.com/allpages
domain.es/en/allpages --redirect 301 to--> eu.newdomain.com/allpages
I tried this, is correct?
To set final urls like:
es.newdomain.com/
pt.newdomain.com/
de.newdomain.com/
fr.newdomain.com/
eu.newdomain.com/
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/es/(.*)$
RewriteRule ^(.*) https://es.newdomain.com/%1 [R=301,NC]
RewriteCond %{REQUEST_URI} ^/pt/(.*)$
RewriteRule ^(.*) https://pt.newdomain.com/%1 [R=301,NC]
RewriteCond %{REQUEST_URI} ^/fr/(.*)$
RewriteRule ^(.*) https://fr.newdomain.com/%1 [R=301,NC]
RewriteCond %{REQUEST_URI} ^/de/(.*)$
RewriteRule ^(.*) https://de.newdomain.com/%1 [R=301,NC]
RewriteCond %{REQUEST_URI} ^/en/(.*)$
RewriteRule ^(.*) https://eu.newdomain.com/%1 [R=301,NC]
My site runs on nginx
I have the code to redirect my root index.html to domain name but I don't know how to redirect index.html files in folders to point to the folder for 301 redirect
example root/folder/index.html to root/folder
this code worked in htaccess to redirect root index.html to domain name
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://%{HTTP_HOST}/ [R=301,L]
I would like to redirect a subdomain to a folder in its main domain. The subdomain is blog.mydomain.com and I would like to redirect it to http://www.mydomain.com/blog.
I have tried to do this using an htaccess file as follows:
RewriteEngine on
Options +FollowSymlinks -MultiViews
RewriteCond %{SERVER_PORT} =80
RewriteCond 5{HTTP-HOST} ^blog.mydomain.com$ [NC]
RewriteRule ^(.*)$ /blog/$1 [PT,L]
but it doesn't work (the redirection does not happen).
Does anyone know how I could do this?
Thank you.
Try with
Redirect 301 / http://www.mydomain.com/blog
If that doesn't work,i'll try something else
I am new to working on a windows server and have been made aware that it is setup for ISPAI Rewrite.
I have tried creating a httpd.ini file and a .conf file with possible redirects but nothing is working.
Could someone show me how to create the correct file and then rewrite the following:
http://aspectexhibitions.co.uk/
Should redirect to:
http://www.aspectexhibitions.co.uk/
--
http://www.aspectexhibitions.co.uk/index.php
http://aspectexhibitions.co.uk/index.php
Should redirect to:
http://www.aspectexhibitions.co.uk/
Done...
[ISAPI_Rewrite]
#Redirect Non WWW to WWW
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
#Redirect index.php to root
RewriteEngine on
RewriteBase /
RewriteRule ^index\.php$ http://www.aspectexhibitions.co.uk/ [NC,R=301,L]
I want to 301 redirect some URLs which contain "option=com_virtuemart".
I tried with this code:
RewriteCond %{QUERY_STRING} ^option=com_virtuemart
RewriteRule ^(.*)$ http://www.newsite.com/$1 [L,R=301]
But it doesn't work.
The code is working, but the server is disabled htaccess controll..