homepage Welcome to WebmasterWorld Guest from 54.237.213.31
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

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

Apache Web Server Forum

    
Mod_rewrite not working
What is wrong?
Jim Westergren

5+ Year Member



 
Msg#: 3901 posted 12:30 am on Jun 23, 2005 (gmt 0)

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

10+ Year Member



 
Msg#: 3901 posted 4:27 am on Jun 23, 2005 (gmt 0)

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

5+ Year Member



 
Msg#: 3901 posted 11:55 am on Jun 23, 2005 (gmt 0)

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

5+ Year Member



 
Msg#: 3901 posted 7:46 pm on Jun 23, 2005 (gmt 0)

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

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3901 posted 7:59 pm on Jun 23, 2005 (gmt 0)

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

5+ Year Member



 
Msg#: 3901 posted 7:59 pm on Jun 23, 2005 (gmt 0)

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

5+ Year Member



 
Msg#: 3901 posted 8:01 pm on Jun 23, 2005 (gmt 0)

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

/ Jim

Jim Westergren

5+ Year Member



 
Msg#: 3901 posted 8:05 pm on Jun 23, 2005 (gmt 0)

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

5+ Year Member



 
Msg#: 3901 posted 8:11 pm on Jun 23, 2005 (gmt 0)

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

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3901 posted 10:18 pm on Jun 23, 2005 (gmt 0)

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

5+ Year Member



 
Msg#: 3901 posted 3:02 am on Jun 25, 2005 (gmt 0)

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

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