473,388 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Redirect webpage.

3
Hello,
Can someone please explain me how to make redirection from:
www.site.com
to
www.site.com/dir

I have multilingual webpage and default language is english, which means that home page is www.site.com/en
When opening www.site.com, content is the same as www.site.com/en so i dont want to have duplicated content (because of search enignes...
Any solution?

Thanks in forward
Mar 6 '09 #1
3 1284
Markus
6,050 Expert 4TB
Please do no Hi-jack other's threads, please.

In your index file (for site.com/), place the below:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. header("Location: dir/");
  4.  
  5. ?>
  6.  
That will redirect you from site.com to site.com/dir/.
Mar 6 '09 #2
ilija
3
Sorry for posting in other topic, but at first I couldnt realize how to start new threar, now I see that I have to go to "answers" section first.

Anyway, I used header() function thousand times, but lately I was occupied with .htaccess redirection and it just took me away from the right solution :-)

Thanks for your answer ;)
Mar 6 '09 #3
Markus
6,050 Expert 4TB
@ilija
You're welcome. .htaccess wouldn't be logical here, but using a simple header() redirect is perfectly logical.
Mar 6 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Don Miller | last post by:
I have an ASP script that is called from a PDF form to process form data. On the last line of the script I have a Response.Redirect "webpage.asp" that leads to another target page with actual HTML....
1
by: Paul Lee | last post by:
Hi all, I'm trying to redirect users from a specific domain to one of my webpages. So, in my example, anyone accessing my index.html from the *btinternet.com domain (allowing for wildcards!) will...
2
by: OnLiner | last post by:
I have a site with hundreds of pages. I often get visits from people who have linked to individual pages and not to the main index page. This means that they do not have the correct...
1
by: Jac | last post by:
Aspx-problem : I want to write code (C-sharp) behind a button, that determines on some criteria which webpage an IFRAME has to show. To change a normal webpage you do a redirect in c-scharp...
2
by: Alan Scott | last post by:
I am using the following code to redirect users to another webpage when they click on an image: Response.Redirect("login.aspx"); The code works. However, I have frames setup and would like the...
9
by: postings | last post by:
Just a quick question... When I do a "response.redirect" from a source webpage to a destination webpage, does the code on the source webpage carry on executing unless I put a "response.end"...
2
by: bryant_j_j | last post by:
Hi everyone, Does anybody know how to redirect every visitor to a webpage, except those coming from some specified IP addresses, to a different webpage? Does anybody know of a JavaScript for...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
1
by: sureshreddy | last post by:
hi friends, I want the time to be displayed for a webpage to redirect to another webpage. You can see this concept in job sites when we fill all the details and click the search button it displays...
10
by: Eirik Eldorsen | last post by:
How can I 301 redirect www.example.com/default.aspx to www.example.com without using ISAPI filters?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.