Forums / General / where can i use redirect!

where can i use redirect!

Author Message

Christine Romel

Thursday 14 October 2004 5:38:06 am

Hi..
my site now is on a test version and not published yet.i want to use redirect so that when the main page is accessed say: www.mySite.com redirect it to www.mySite.com/test/
i want to do this instead of removing the whole site from test to the root..
how and where can i use that..
i got that javascript <meta http-equiv="refresh" content="0";url="http://www.mySite.com/test/">..

so if it is right.. which index file and where should i place that script!

i need a fast reply plzzz..

thanx for ur cooperation:)

Alex Jones

Thursday 14 October 2004 6:53:32 am

Hi, I think you would be better off using an .htaccess file for this - assuming you are using Apache. To do this, follow these steps:

1. In a text editor create a file named .htaccess (the dot is important)
2. Add this line to the file:

redirect 301 / /test/ 

3. Save the file, and upload it to the root directory on the site

The reason, I recommend this method is that it will ensure search engines know that the site has been moved, and it is transparent to the user, whereas a meta refresh can be stored in the browser's history, frustrating the user if they try to use their browser's back button. They click on the back arrow, which takes them to the page with the meta refresh, which automatically sends them back to the page they were on - an annoying loop.

One quick note, you may need to tell your operating system, and/or your HTML editors may not show you the .htaccess file once it is created, as the dot at the beginning indicates that it is supposed to be a hidden file. So, you may need to change some settings to make sure that you can see it.

<b>Additional Info:</b> See 'Strategy 2' on http://www.tamingthebeast.net/articles3/spiders-301-redirect.htm

Hope this helps. If not, let me know.

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

eZ debug

Timing: Jan 31 2025 00:22:48
Script start
Timing: Jan 31 2025 00:22:48
Module start 'content'
Timing: Jan 31 2025 00:22:48
Module end 'content'
Timing: Jan 31 2025 00:22:48
Script end

Main resources:

Total runtime0.1790 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 587.9063370.3047
Module start 'content' 0.00780.0126 958.21091,001.5938
Module end 'content' 0.02050.1585 1,959.80473,890.1875
Script end 0.1789  5,849.9922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00432.3858200.0002
Check MTime0.00130.7372200.0001
Mysql Total
Database connection0.00120.655410.0012
Mysqli_queries0.090250.39351410.0006
Looping result0.00110.60621390.0000
Template Total0.158188.310.1581
Template load0.00060.356510.0006
Template processing0.157587.980610.1575
Override
Cache load0.00040.249210.0004
Sytem overhead
Fetch class attribute can translate value0.00181.028110.0018
XML
Image XML parsing0.00020.138010.0002
General
dbfile0.00673.7703200.0003
String conversion0.00000.002730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs