Forum Moderators: phranque

Message Too Old, No Replies

Fmyscript .htaccess problem with Disable Multiviews! Pls Help me!

         

DontQuitB4Success

2:46 pm on Jun 2, 2010 (gmt 0)

10+ Year Member



Hey members webmasterworld.com, pls help me with this modrewrite in .htaccess.
I 'm totally new in this area and need your helping alot.
Here 's my problem:
I'm using FMyScript on Bluehost and there 's a problem with multiviews mode. I have to disable the Multiviews.
I see some help in the forum and adding this to htaccess:
---
# Enable mod_rewrite, disable multiviews
# For security reasons, Option followsymlinks cannot be overridden.
#Options -multiviews
Options -multiviews
# Turn on the rewrite engine
# Rewrite URL-paths not ending with a filetype (".") or trailing slash (in any {sub}directory) to <URL-path>.php
--
And it work with :RewriteRule ^signup$ /signup.php for example.
But there 're still a problem 404 with category, view, and members.
I don't understand why this code above just goes fine with "^signup$ /signup.php" (1 slash) but with 2 slash like "category/(.*)/(.*)" It's still wrong (404).
Pls help me with this! What I have to do now!

-------
my .htaccess right now (not full, just to show where is problem)
------
<IfModule mod_rewrite.c>
# Enable mod_rewrite, disable multiviews
# For security reasons, Option followsymlinks cannot be overridden.
#Options -multiviews
Options -multiviews
# Turn on the rewrite engine
# Rewrite URL-paths not ending with a filetype (".") or trailing slash (in any {sub}directory) to <URL-path>.php
RewriteRule ^(([^/]+/)*([^./]+))$ $1.php [L]
RewriteEngine on
RewriteRule ^signup$ /signup.php
RewriteRule ^view/(.*)/(.*) /view.php?cat=$1&pid=$2
RewriteRule ^category/(.*)/(.*) /category.php?cat=$1&name=$2
RewriteRule ^members/(.*)/(.*) /memberprofile.php?pid=$1&name=$2

g1smd

4:16 pm on Jun 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The biggest problems with your code are the multiple (.*) patterns which should be changed to something more efficient. For example ([^/]+) and ([^/.]+)$ will parse hundreds of times faster.

Every rule needs the [L] flag added too.

The first rule 'grabs' most requests. It needs to be listed last.

DontQuitB4Success

1:41 am on Jun 3, 2010 (gmt 0)

10+ Year Member



g1smd can you provide me an example:
how can change the script:
RewriteRule ^members/(.*)/(.*) /memberprofile.php?pid=$1&name=$2
?
Pls help

g1smd

7:29 am on Jun 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Change the two (.*) patterns as described in the post above.

Add the [L] flag as described in the post above.

jdMorgan

1:10 pm on Jun 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Note also that the "RewriteEngine on" directive is out of order. If you want the first RewriteRule to execute, then move it below "RewriteEngine on"...

Jim

DontQuitB4Success

3:36 pm on Jun 4, 2010 (gmt 0)

10+ Year Member



I have tried fix htaccess with recommends by g1smd but there's still the same. Sry, I totally a beginner and don't know about coding :(
Someone help me writing the code out for me. Just a piece of cake for you, but it really turn me mad :((

DontQuitB4Success

3:37 pm on Jun 4, 2010 (gmt 0)

10+ Year Member



I have tried fix htaccess with recommends by g1smd but there's still the same. Sry, I totally a beginner and don't know about coding :(
Someone help me writing the code out for me. Just a piece of cake for you, but it really turn me mad :((

jdMorgan

3:51 pm on Jun 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Someone help me writing the code out for me.

Please see our Apache Forum Charter [webmasterworld.com] for important information and links to relevant resources.

Thanks,
Jim

DontQuitB4Success

4:12 pm on Jun 4, 2010 (gmt 0)

10+ Year Member



wow, thx u jdMorgan, I have read the rule now, sorry for that.