GIDForums  

Go Back   GIDForums > Web Hosting Forums > Apache Web Server Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-Jul-2003, 11:44
Zergus Zergus is offline
New Member
 
Join Date: Jul 2003
Posts: 4
Zergus is an unknown quantity at this point

Problem with .htaccess


Hello guys,

does anyone knows how to pass the parameters into script using "RewriteRule".
I've tried the following:
RewriteEngine on
RewriteRule ^(.*\.html)$ /_www/index.php?$1

But it shows the source of my PHP file.... I need to execute it and pass there a parameter. How it could be done?

Please help me.

Best regards,
Zemnon
zemnon.org.ua
  #2  
Old 28-Jul-2003, 16:52
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Hello Zergus,

Your rewrite rule below:
Code:
RewriteEngine on RewriteRule ^(.*\.html)$ /_www/index.php?$1

where did you get this?

Let's say you have a link on your web page now that looks like this: http://zemnon.org.ua/example.html...

The page will fail because this is what the server will try to 'process': /_www/index.php?example.html - that is simply NOT valid.
  #3  
Old 29-Jul-2003, 09:53
Zergus Zergus is offline
New Member
 
Join Date: Jul 2003
Posts: 4
Zergus is an unknown quantity at this point
Hello,

Thank you for your reply....

I realy appriciate it ..

But now I get another problem....

It gives me the PHP-source of my index.php file and won't execute it even if I use the following in my .htaccess file:

RewriteEngine on
RewriteRule ^(.*\.html)$ localhost$1

Waiting for your reply.

Best regards,
Zemnon
zemnon.org.ua
  #4  
Old 29-Jul-2003, 10:05
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
It seems you've missed the point of my reply. Your pattern is not perfect: i.e.
Code:
RewriteRule ^(.*\.html)$

This captures everything including the .html part in the url.

So if you have a link like http://localhost/something.html, the server will try to process: http://localhost/index.php?id=something.html

How is that valid?
  #5  
Old 29-Jul-2003, 10:35
Zergus Zergus is offline
New Member
 
Join Date: Jul 2003
Posts: 4
Zergus is an unknown quantity at this point
Hello,

It seems you've not got what I am talking about.

This pattern is working and capturing the url on which it is reffered.

So I need to do the following:
someurl - this query should return as the result data from my script so I need to pass the name of the html file inside of the script and execute it, but it still won't work, because it shows the content of my index.php file.



I appriciate you attantion.

Best regards,
Zemnon
zemnon@zemnon.org.ua
  #6  
Old 29-Jul-2003, 10:49
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

What about your Apache httpd.conf settings?


As long as you say that's exactly what you're hoping to catch then you're okay I suppose...

In Apache's httpd.conf setting for:
Code:
DirectoryIndex index.php index.html
and
Code:
AddType application/x-httpd-php .php

Are you certain that you get index.php okay without the rewriting?

You also realise that a link like http://localhost/someotherfolder/something.html will process this http://localhost/index.php?id=someotherfolder/something.html
  #7  
Old 29-Jul-2003, 10:54
Zergus Zergus is offline
New Member
 
Join Date: Jul 2003
Posts: 4
Zergus is an unknown quantity at this point
Yes, my php is working ok without rewriting...

Please, don't describe everything as I am some kind of a kid that is making "Hello world" PHP file.

I am an advanced PHP programmer and just have trouble with this issue.

As you've said it's not correct. Because when it's no type for php file apache query the user to download the file.

Thanx anyway.

Best regards,
Zemnon
zemnon.org.ua
  #8  
Old 29-Jul-2003, 11:01
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
You know Zergus, when you're new to a forum / community, nobody knows what you know and you cannot expect people here to expect that you're some kind of a PHP guru.

Your question was vague, you didn't tell us what you already know and you didn't say what exactly you wanted to get off your rewrite rule.

When I am trying to diagnose your issue, you turn around and feel insulted.

If you feel offended, then do everyone here a favour and ask your 'expert' questions at some other forum where the members are able to read your mind
 
 

Recent GIDBlogHalfway done! by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess on Windows2k, and the trailing slash Pedster2k Apache Web Server Forum 6 24-Jan-2004 17:32
.htaccess language / rewrite problem spinflip Apache Web Server Forum 5 15-Dec-2003 14:14
problem with php5 cgi installation fab13 Apache Web Server Forum 3 19-Nov-2003 09:11
unwanted scrollbar problem kelly001 Web Design Forum 3 24-Oct-2003 10:44
How I sorted my website compression problem jrobbio MySQL / PHP Forum 0 05-Mar-2003 20:41

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:05.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.