FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

.htaccess redirect?

 


Diablosblizz
Hey, I am wondering if it is possible to redirect a lot of pages to a different folder? For example, if I have a page called cp.php, but the file is not located in the main directory am I able to redirect it to the /membership/ folder with .htaccess?

I want to avoid using URLS to redirect.

Thanks and kind regards!
alalex
The easiest possible way is to use mod_rewrite inside your .htaccess file. Most actual Apache servers have that module installed, if you do have it you'll find a lot easier to redirect the pages.

Here is an article on how to use it, read it and try to work out the redirections. If you have problems post a link and we'll try to solve it Wink
oliveiraw
1. To create a .htaccess file, open notepad, name and save the file as .htaccess (there is no extension).

2. If you already have a .htaccess file on your server, download it to your desktop for editing.

3. Place this code in your .htaccess file:

redirect 301 /old/old.htm http://www.you.com/new.htm

4. If the .htaccess file already has lines of code in it, skip a line, then add the above code.

5. Save the .htaccess file

6. Upload this file to the root folder of your server.

7. Test it by typing in the old address to the page you've changed. You should be immediately taken to the new location.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.