Free Web Hosting Forum
(#1 (permalink))
Old
Solstice's Avatar
Senior Member
Solstice is on a distinguished road
 
Posts: 172
Join Date: Mar 2010
Default I want a simple .htaccess re-route - 11-27-2010, 02:54 AM

Hi I already have one simple re-route in my .htaccess - it takes requests for the main url and sends it to a specific forum inside my mybb site. This is done like so:

Code:
DirectoryIndex forumdisplay.php?fid=6
What I need now is for any requests for site.com/index.php or any other php file and and any requests for any other directory (i.e. site.com/openx/) to also redirect to this same specific forum.

There may be more than one way to do this and I suppose I would be looking for the simplest one.

Any suggestions?

Reply With Quote
Sponsored Links
(#2 (permalink))
Old
lobrc's Avatar
Administrator
lobrc is on a distinguished road
 
Posts: 5,046
Join Date: Jan 2010
Location: http://www.lobrc.net
Default 11-27-2010, 08:50 AM

Try this:

Code:
Redirect 301 / /forumdisplay.php?fid=6


FREE SCRIPT INSTALLATION SERVICE | PREMIUM HOSTING* | LOBRC.NET

*All packages include Quality Support, Website Builder, Free Site Migration, 30 Day Money Back Guarantee, Official cPanel and Fantastico Autoinstaller.

Plus get 20% off with promo code 000WH20. Contact sales for more information.
Reply With Quote
(#3 (permalink))
Old
Solstice's Avatar
Senior Member
Solstice is on a distinguished road
 
Posts: 172
Join Date: Mar 2010
Default 11-27-2010, 09:58 AM

Wow that is simple. Would that work without even specifying any .php files or directories? Or does the slash specify any directory.

I will try it out.
Reply With Quote
(#4 (permalink))
Old
Solstice's Avatar
Senior Member
Solstice is on a distinguished road
 
Posts: 172
Join Date: Mar 2010
Default 11-27-2010, 10:03 AM

It didn't work.

When I added that line to .htaccess the site would no longer load and would instead give a generic 'page will not display' page. Same thing happened when I tried it with both that line and my previous line and also with your line only by itself.

Any other suggestions?
Reply With Quote
(#5 (permalink))
Old
lobrc's Avatar
Administrator
lobrc is on a distinguished road
 
Posts: 5,046
Join Date: Jan 2010
Location: http://www.lobrc.net
Default 11-27-2010, 11:37 AM

Try using the full domain.
Quote:
redirect 301 / http://www.yourdomain.com/page.html
That should redirect your whole site to a specific page.


FREE SCRIPT INSTALLATION SERVICE | PREMIUM HOSTING* | LOBRC.NET

*All packages include Quality Support, Website Builder, Free Site Migration, 30 Day Money Back Guarantee, Official cPanel and Fantastico Autoinstaller.

Plus get 20% off with promo code 000WH20. Contact sales for more information.
Reply With Quote
(#6 (permalink))
Old
Solstice's Avatar
Senior Member
Solstice is on a distinguished road
 
Posts: 172
Join Date: Mar 2010
Default 11-27-2010, 10:18 PM

Thank you for your help again but it didn't work.

The following line by itself gave 'Internal Server Error'

Code:
redirect 301 / forumdisplay.php?fid=2
and this line by itself also gave 'Internal Server Error' (apon adding in my site name, of course)

Code:
redirect 301 / http://www.mysite.com/forumdisplay.php?fid=2
Let me ask my question again , more specifically.

I think I don't want my entire site redirecting to one page. I'd like any requests for "http://www.mysite.com/index.php" to redirect to forumdisplay.php?fid=2 (while either showing http://www.mysite.com/index.php in the url bar or showing http://www.mysite.com/ in the url bar)

and also any requests for "http://www.mysite.com/*.php" to do the same thing. (where * represents any other php file _by itself_ in the called url)

and also any requests for "http://www.mysite.com/*/" to do the same thing. (where * represents any other directory in the called url)

I think what I'm needing may not be a 301 redirect by the true definition of the term redirect.

Any other suggestions are welcome. Otherwise I will keep trying to figure it out in a net search on .htaccess .

Thank you
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com