Jump to content


Subfolder redirect


4 replies to this topic

#1 jazzyfan

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 26 August 2007 - 10:02 PM

I have a question for you guys.

Let's say I have a site called mywebsite.com.

A user types in mywebsite.com/something. I want that address to lead him to a webpage. How do I do this?

Thanks.

#2 Balor

    PHP Nerd

  • Members
  • Pip
  • 63 posts
  • Gender:Male
  • Location:Germany->Frankfurt
  • Interests:My beautyful girl, my son and webcoding. I'm also very interested in art but I'm not really good at art... it's sad but true ^^

Posted 27 August 2007 - 02:09 AM

What exactly do you mean? A simple redirect to another website located on another domain(for example: mywebsite.com/xyz directs to yourwebsite.com) or do you wan to redirect it to the same domain with a specific parameter(for example: mywebsite.com/users/4 directs to mywebsite.com?uid=4)?

The first thing could easily be done with a simple meta:

<meta http-equiv="Refresh" content="1; URL=http://www.cs.uni-frankfurt.de/~www1test/redirect.html">

For the second type you would need a .htaccess file and the mod_rewrite engine:

RewriteEngine on
RewriteRule ^/kategorien/([0-9]+)$ /warenkorb.php?action=show&kat=$1

Hope this helps.

Sincerely,
Chris

#3 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 27 August 2007 - 03:19 PM

Use the Apache Mod_Rewrite module, do a search and there are plenty of topics discussing how to use it on these forums, and just about anywhere on Google.

#4 jazzyfan

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 27 August 2007 - 09:50 PM

I'm not sure any of that's going to work for my site, but thanks anyways. I appreciate it.

I'm on Windows server, and PHP is not a possibility for me, and I have no clue about programming languages at all.

But thanks anyway. :lol:

#5 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 28 August 2007 - 05:38 PM

Nothing posted here has to do with PHP.

.htaccess has nothing to do with PHP, it is an Apache mod, so if you have the Apache server running for your web server, then you can use it.

A meta refresh is a piece of HTML, so if you are outputting a webpage in HTML, you can use it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users