homepage Welcome to WebmasterWorld Guest from 54.211.201.65
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Mod Rewrite
PaRaDiGm11




msg:4601613
 8:13 pm on Aug 13, 2013 (gmt 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.

 

g1smd




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

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

Use example.com in place of the real hostname.

PaRaDiGm11




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

domain.com?group_id=2 or domain.com/script/tube/?group_id=2 or domain.com/index.php?group_id=2

lucy24




msg:4601627
 9:19 pm on Aug 13, 2013 (gmt 0)

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.

PaRaDiGm11




msg:4609395
 9:04 pm on Sep 12, 2013 (gmt 0)

1. Index remain
2. index.php, i tried also with it, it doesn't work.

lucy24




msg:4609399
 9:24 pm on Sep 12, 2013 (gmt 0)

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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved