Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

.HTACCESS permissions/RewriteRule
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1

TOPIC: .HTACCESS permissions/RewriteRule

.HTACCESS permissions/RewriteRule 17 years, 3 months ago #3166

I have a Joomla site that uses ArtioSEF at www.otcpicks.com — the site works perfectly.

The old version of my site used to be at www.otcpicks.net

OTCPicks.com is a financial site, and in my pre-Joomla days I was using a bit of PHP script that would allow me to create custom stock quote pages \"dynamically\" in the following way...

There's a service called QuoteMedia that provides free scripts that will generate stock quotes on a webpage. I had some modified PHP code set up in a directory called /quotes that did the following:

If you went to www.otcpicks.net/quotes/DELL.php — it would automatically read in the \"DELL.php\" and understand that the \"DELL\" part was the stock symbol parameter that should be passed on to the QuoteMedia script running on that page.

The PHP code that did this was contained in a file called \"index.php\" and looks like this:

<?
$temp=explode('/',preg_replace('/[^a-z.\/]/','',strtolower($_SERVER['REQUEST_URI'])));
$temp=explode('.',array_pop($temp));
$symbol=substr(array_shift($temp),0,5);
$ext=array_shift($temp);
?>

In fact, if you go to www.otcpicks.net/quotes/DELL.php or any other stock symbol for that matter), it still works just fine.

However, when I tried to move this same exact code over to www.otcpicks.com/quotes — I get a permission error.

I've been fooling around with the .htaccess file to see if I can get it to work... and I can see it has something to do with the line:

RewriteRule (.*) index.php

If I change that to: RewriteRule (.*) quotes/index.php then it \"works too well\" — and *every* page URL gets translated by the QuoteMedia script!

I am by no means an expert in the arcane world of .htaccess! I feel like it's something simple that I'm overlooking...

Can anybody help?
  • Page:
  • 1
Přihlášení uživatele Prázdný