Welcome to WebmasterWorld Guest from 107.20.75.63

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Mod Rewrite

     
8:13 pm on Aug 13, 2013 (gmt 0)

New User

5+ Year Member

joined:Sept 20, 2006
posts:6
votes: 0


Hello,

I'm using a script which have a crypted index.php file in the domain root and which "include" to the script template /script/tube/index.php

There are already a htaccess created with some mod_rewrite like:

RewriteRule ^models/$ /script/tube/?force_template=model_list [L]
...

I would like /script/tube/?group_id=2 to be the main page ( ie domain.com )

I tried:

RewriteRule ^$ /script/tube/?group_id=2 [L]

But it doesn't work.

Thanks for your help.
8:15 pm on Aug 13, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


What is the URL (with parameters) that you currently use to access that page?

Use example.com in place of the real hostname.
8:28 pm on Aug 13, 2013 (gmt 0)

New User

5+ Year Member

joined:Sept 20, 2006
posts:6
votes: 0


domain.com?group_id=2 or domain.com/script/tube/?group_id=2 or domain.com/index.php?group_id=2
9:19 pm on Aug 13, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12714
votes: 244


Not the URL you want to use. The URL you actually do use. Most likely
example.com/index.php

I tried:

RewriteRule ^$ /script/tube/?group_id=2 [L]

But it doesn't work.

#1 what happens when you try?
#2 what's after /tube/ ? This is a rewrite, not a redirect, so there's no reason to suppress the index.php or whatever it is.
9:04 pm on Sept 12, 2013 (gmt 0)

New User

5+ Year Member

joined:Sept 20, 2006
posts:6
votes: 0


1. Index remain
2. index.php, i tried also with it, it doesn't work.
9:24 pm on Sept 12, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12714
votes: 244


For testing purposes, replace [L] alone with [R,L]. This is an easy way to see whether the intended redirect/rewrite is taking place, since your browser's address bar will change. (In rare cases, rules creating a redirect will behave differently from rules creating a rewrite alone. But it shouldn't apply here.)

As noted above, there's no reason to use a final / in a rewrite. Say explicitly /index.php or whatever the extension is. Using / may invite trouble, because now another module, mod_dir, has to get involved before the rule can take effect.

If you change to /index.php, make sure your index-redirect (earlier in the RewriteRule section of htaccess) has a RewriteCond looking at {THE_REQUEST} so you don't get an infinite loop.

Do you have any other htaccess files affecting the same domain? If so, do they include mod_rewrite? In the htaccess we're talking about, do you have any RewriteRules that definitely do work?
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members