Hi! Are mod_rewrite directives in .htaccess allowed in the servers I need to install a contribution in OSC. Thanks.
mod_rewrite directives in .htaccess
Collapse
X
-
Tags: None
-
Yes they are. We are using them on our site to do 301 redirects.Kerry Slavin
Reliable Solution Internet Services
For the best independent support for webhosts & their customers visit -
JointSupportForum.Com -
I've got a similar problem so I'll post it here if ok =)
this is my index.php:
--------------------------
or ($i=1; $i < 10; $i++)
{
echo '<a href="index.php?l='.$i.'">Link '.$i.'</a><br />';
}
---------------------------
and this is my .htaccess file:
----------------------------
RewriteEngine On
RewriteRule ^index/(.*).php /index.php?l=$1
----------------------------
Both files are in public_html/
The links wont rewrite... what am I doing wrong?Comment
-
First problem that I see... Periods are special characters in regular expressions. To find an actual period you need to use a backslash like this:Originally posted by superflyRewriteEngine On
RewriteRule ^index/(.*).php /index.php?l=$1
Second problem... If index is a directory then it should probably begin with a forwardslash unless your using RewriteBase.Code:\.
See if this works...
Code:RewriteEngine On RewriteRule ^/index/(.*)\.php /index.php?l=$1
"Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - BuddhaComment
-
I don't think mod_rewrite solution works on Dathorn servers.The links wont rewrite... what am I doing wrong?
I've asked Andrew and he said he is not sure if this is going to work.
The ForceType directive in .htaccess doesn't work either
.
Does anybody using Dathorn servers has implemented search engine friendly URLs and if yes, how?
Thanks,
PeterComment
-
Hi guys,
I need some help with mod_rewrite please.
I've tried Buddha's example and it didn't work.
Here is my setup:
.htaccess file in the root of public_html folder
this is the .htaccess content
.htaccess has 755 permissionsCode:RewriteEngine On RewriteRule ^/article/(.*)\.php /article.php?l=$1
=========================================
article.php in the root of public_html folder
=========================================
When I type:
http://my-domain-name.com/article/something-here.php
I get Not Found error.
What am I doing wrong?
Thanks in advance,
PeterComment
-
If you have an "article" directory, I think you might get a 404.
Just a note of caution: You can create an endless loop with a rewrite, just be careful what your doing.Last edited by Buddha; 05-20-2004, 10:00 PM."Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - BuddhaComment
-
I don't have article folder, but I've renamed the file to article1.php just in case and I've changed it the .htaccess file too - got the same error againOriginally posted by BuddhaIf you have an "article" directory, I think you might get a 404.
Just a note of caution: You can create an endless loop with a rewrite, just be careful what your doing.
Comment
-
I fixed the problem
.
The rewrite rule line was wrong. It was:
and I've changed to:Code:RewriteRule ^/article/(.*)\.php /article.php?l=$1
and now it finds article.phpCode:RewriteRule ^article/(.*)\.php /article.php?l=$1
Thanks for the help guys,
PeterComment
-
mm, I'm wondering;
I'm thinking of making my new site using
PHP includes, and a file.php?id=casename
sort of URL........
Basicly, load the include as if it
were an iFrame file, except of course ~ it isn't.
But, could I use (and if so, how) mod rewrite
to make 'index.php?id=hosting' actually show, in the URL
as 'domain.com/hosting/' ? Basicly, for search-engine friendly URLs..."How can someone be so distracted yet so focused?"
- CComment
-
Jonathan you wouldn't need to do a mod_rewrite if you let Apache do it's job as the front controller. I would think that PHP-Nuke's front controller architecture would be one of the problem you would want to avoid in your own CMS?
petert: Sorry been writing too many rewrite rules in .conf you don't need that leading slash in .htaccess."Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - BuddhaComment
Comment