![]() |
|
#1
|
|||
|
|||
Problem with .htaccessHello 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
|
||||
|
||||
|
Hello Zergus,
Your rewrite rule below: Code:
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. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
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
|
||||
|
||||
|
It seems you've missed the point of my reply. Your pattern is not perfect: i.e.
Code:
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? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#5
|
|||
|
|||
|
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
|
||||
|
||||
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:
Code:
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 __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#7
|
|||
|
|||
|
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
|
||||
|
||||
|
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 __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
Halfway done! by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
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