Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Tutorials (http://www.bvlist.com/forumdisplay.php?f=61)
-   -   Force users to another page not index (http://www.bvlist.com/showthread.php?t=5831)

daffy 21st December 2010 19:36

Force users to another page not index
 
1 Attachment(s)
ok some ppl wonderd how to force users when coming to site, to view a page not index.php


heres how i done it.

creat a blank index.html and place into root

add this to your .htaccess or create .htaccess and place this inside

Code:

DirectoryIndex name_of_file.php
Redirect 301 /currentLocation http://sitename.com/name_of_file.php

enter the page name you want users to go to when coming to your site.
no instead of users gettin index.php they will get login.php or forums.php or signup.php whatever you want first page view to be. hope this helps

draconian 21st December 2010 20:08

Is this how its suppose to look?

Code:

DirectoryIndex index.php
Redirect 301 /currentLocation http://mysitename/login.php
Options +FollowSymLinks
RewriteEngine On


    order allow,deny
    deny from all


ErrorDocument 400 /ts_error.php?errorid=400
ErrorDocument 401 /ts_error.php?errorid=401
ErrorDocument 403 /ts_error.php?errorid=403
ErrorDocument 404 /ts_error.php?errorid=404
ErrorDocument 500 /ts_error.php?errorid=500

# //seo_mod_start
# Uncomment the following and add your tracker path if rewrites arent working properly
#RewriteBase /
RewriteRule ^index.html$ index.php [L,NE]
RewriteRule ^(.*)-b-([0-9]+).ts(.*)$ browse.php?cat=$2 [QSA,L]
RewriteRule ^(.*)-c-([0-9]+).ts(.*)$ browse.php?browse_categories&category=$2 [QSA,L]
RewriteRule ^(.*)-d-([0-9]+).ts(.*)$ download.php?id=$2 [QSA,L]
RewriteRule ^(.*)-s-([0-9]+).ts(.*)$ details.php?id=$2 [QSA,L]
RewriteRule ^(.*)-a-(.*).ts(.*)$ announce.php?passkey=$2 [QSA,L]
RewriteRule ^(.*)-u?([0-9]+).ts(.*)$ userdetails.php?id=$2$3 [QSA,L]
RewriteRule ^(.*)-f([0-9]+).tsf(.*)$ tsf_forums/index.php?fid=$2$3 [QSA,L]
RewriteRule ^(.*)-fd([0-9]+).tsf(.*)$ tsf_forums/forumdisplay.php?fid=$2$3 [QSA,L]
RewriteRule ^(.*)-t([0-9]+).tsf(.*)$ tsf_forums/showthread.php?tid=$2$3 [QSA,L]
# //seo_mod_end


   
        ExpiresActive On
        ExpiresDefault "access plus 10 years"
   




  Header unset Last-Modified


FileETag none
php_flag short_open_tag on
php_flag register_globals off


daffy 21st December 2010 20:14

DirectoryIndex index.php

should be

DirectoryIndex login.php

draconian 21st December 2010 20:19

Quote:

Originally Posted by daffy (Post 26127)
DirectoryIndex index.php

should be

DirectoryIndex login.php

ok edited that but it still isnt redirecting. hmm.

Code:

DirectoryIndex login.php
Redirect 301 /currentLocation http://mytracker.com/login.php
Options +FollowSymLinks
RewriteEngine On


    order allow,deny
    deny from all


ErrorDocument 400 /ts_error.php?errorid=400
ErrorDocument 401 /ts_error.php?errorid=401
ErrorDocument 403 /ts_error.php?errorid=403
ErrorDocument 404 /ts_error.php?errorid=404
ErrorDocument 500 /ts_error.php?errorid=500

# //seo_mod_start
# Uncomment the following and add your tracker path if rewrites arent working properly
#RewriteBase /
RewriteRule ^index.html$ index.php [L,NE]
RewriteRule ^(.*)-b-([0-9]+).ts(.*)$ browse.php?cat=$2 [QSA,L]
RewriteRule ^(.*)-c-([0-9]+).ts(.*)$ browse.php?browse_categories&category=$2 [QSA,L]
RewriteRule ^(.*)-d-([0-9]+).ts(.*)$ download.php?id=$2 [QSA,L]
RewriteRule ^(.*)-s-([0-9]+).ts(.*)$ details.php?id=$2 [QSA,L]
RewriteRule ^(.*)-a-(.*).ts(.*)$ announce.php?passkey=$2 [QSA,L]
RewriteRule ^(.*)-u?([0-9]+).ts(.*)$ userdetails.php?id=$2$3 [QSA,L]
RewriteRule ^(.*)-f([0-9]+).tsf(.*)$ tsf_forums/index.php?fid=$2$3 [QSA,L]
RewriteRule ^(.*)-fd([0-9]+).tsf(.*)$ tsf_forums/forumdisplay.php?fid=$2$3 [QSA,L]
RewriteRule ^(.*)-t([0-9]+).tsf(.*)$ tsf_forums/showthread.php?tid=$2$3 [QSA,L]
# //seo_mod_end


   
        ExpiresActive On
        ExpiresDefault "access plus 10 years"
   




  Header unset Last-Modified


FileETag none
php_flag short_open_tag on
php_flag register_globals off


daffy 21st December 2010 20:21

thats correct, clear your cache from browser and reload browser. it works for me anyway.

draconian 21st December 2010 20:34

omg now this is really wierd, i tried the .htaccess on the test site hosted locally and it worked but it isnt working with the site hosted on my linux server!

alright checked the apache logs and it was some kinda directive error so this is what i changed and it works.

anyone who has problem getting it to work, try this:

Code:

1) check that /etc/http/conf/httpd.conf "Allowoverride is set to "All"

Eg: AllowOverride All

2) open /etc/httpd/conf.d/welcome.conf

locate "Options -Indexes"

replace with "Options Indexes"

&& thanks daffy :)


All times are GMT +2. The time now is 18:54.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.