Welcome to WebmasterWorld Guest from 54.159.44.227

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Mod_rewrite not working

What is wrong?

     

Jim Westergren

12:30 am on Jun 23, 2005 (gmt 0)

10+ Year Member



I have this in my .htaccess

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^([^/]+)/([^/.]+)/?$ /index.php?act=play&id=$1&cid=$2 [NC,L]

Why is not working?

I also tried:

RewriteRule ^([0-9]*).html$ index.php?act=play&id=$1&cid=$2 [L]

And:

RewriteRule ^(.*)/(.*).html /index.php?act=play&id=$1&cid=$2 [L]

But none working.

/ Jim

catch2948

4:27 am on Jun 23, 2005 (gmt 0)

10+ Year Member



Hmmm ... Try adding "AcceptPathInfo On" to the top of your .htaccess file, and see what happens ... Worked for me recently in similar situation ...

Jim Westergren

11:55 am on Jun 23, 2005 (gmt 0)

10+ Year Member



No, it didn't help.

These lines work fine, but not the other ones.

RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ [domain.com...] [R=permanent,L]

Thanks in advance.

Jim Westergren

7:46 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



I have worked out another version with the help of another person.

I just have to get this working:

Options +FollowSymLinks
RewriteEngine on

<Files play>
ForceType application/x-httpd-php
</Files>

But it doesn't take it and I cannot find the reason. Do I have to get my web host to do something?

/ Jim

jd01

7:59 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could you please define 'not working' and provide an example of the URL you are trying to qualify... from the sample rules you have posted, the first should qualify:

yoursite.com/file OR
yoursite.com/file/

The second two should work with
yoursite.com/file.html

Also, do you have any other rules or directives in your htaccess or httpd.conf file that may be in conflict or acting on the URL's before they are tested against this rule?

Justin

Jim Westergren

7:59 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



From the error log:
[Thu Jun 23 15:42:34 2005] [error] [client 213.214.231.45] Premature end of script headers: /home/arcade/public_html/play

Jim Westergren

8:01 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



My last post was at the same time as yours, didn't see it. Wait 1 min and I will answer.

/ Jim

Jim Westergren

8:05 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Ok.

Skip the first post I made. I got help from another person and he made a full script for me to handle my URLs.

I currently have these:

[domain.com...]

If I get the script to work the URL will be:
[domain.com...]

It is this from the .htaccess that is not working:

<Files play>
ForceType application/x-httpd-php
</Files>

I have no other rules in that nor in the httpd.conf.

The guy who helped me has made a file called play which has a PHP script.

I hope you understand more now, sorry but I am new to this.

Jim Westergren

8:11 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Forgot to mention:

It works to get into the index file and all the links are find but when I click on any link it gets a 500.

jd01

10:18 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, I am still not sure what you mean... Sorry, I am very visual.

You say if the script works the URL will be this:
http://www.domain.com/play/name_of_game

Is the script going to create the URL?

As far as the force application type, don't use this much myself, but here's a couple of things to try: (please, keep in mind /page/ is a directory, not technically a file)

<directory /play>
ForceType application/x-httpd-php
</directory>

<location /play>
ForceType application/x-httpd-php
</location>

Hope this give you some ideas...

Also see: [httpd.apache.org...]

Justin

Jim Westergren

3:02 am on Jun 25, 2005 (gmt 0)

10+ Year Member



Thanks for your help.

play is a PHP file but looks like a directory if it works like it should.

I couldn't solve it so I did the ultimate solution, changed webhost!

Now it is working.

Thanks anyway.

/ Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month