OVH Community, your new community space.

URL rewriting on Release 2 (Gentoo)


melat0nin
02-06-2010, 10:07
Quote Originally Posted by gregoryfenton
The below works for me:
.htaccess
Code:
                                                                                                     
RewriteEngine On                                                                                                             
RewriteBase /~scotlawc                                                                                                            
RewriteCond %{REQUEST_FILENAME} !-f                                                                                          
RewriteCond %{REQUEST_FILENAME} !-d                                                                                          
                                                                                                                             
RewriteRule ^(.*) index.php?params=$1 [L]                                                                                     
index.php
Code:
";                                                                                               
$params=stripslashes($_GET['params']);                                                                                       
echo $params,"

"; $continue=0; switch ( $params ) { case "about-us": case "about" : case "aboutus" : echo "about-us is being called"; include "/about-us.php"; break; case "contact" : echo "contact is being called"; include "/contact.php"; break; default: $continue=1; } if($continue == 0) { # do nothing } else { # rest of index.php goes here ?>Welcome to the default page of SomeSite, Inc.
Thanks for the reply. That's not really practical, because the site will have *many* sub-pages (about-us and contact-us were just examples) and to list them all would be incredibly complex, not to mention a nightmare for users when a new one is created.

Surely there is a proper htaccess way around this? It appears though that RPS servers are not configured in a vanilla fashion with regard to URL rewriting, so if any OVH staff have any details on what the differences are and how to implement URL rewriting on a RPS it would be much appreciated!

gregoryfenton
01-06-2010, 20:21
The below works for me:
.htaccess
Code:
                                                                                                     
RewriteEngine On                                                                                                             
RewriteBase /~scotlawc                                                                                                            
RewriteCond %{REQUEST_FILENAME} !-f                                                                                          
RewriteCond %{REQUEST_FILENAME} !-d                                                                                          
                                                                                                                             
RewriteRule ^(.*) index.php?params=$1 [L]                                                                                     
index.php
Code:
";                                                                                               
$params=stripslashes($_GET['params']);                                                                                       
echo $params,"

"; $continue=0; switch ( $params ) { case "about-us": case "about" : case "aboutus" : echo "about-us is being called"; include "/about-us.php"; break; case "contact" : echo "contact is being called"; include "/contact.php"; break; default: $continue=1; } if($continue == 0) { # do nothing } else { # rest of index.php goes here ?>Welcome to the default page of SomeSite, Inc.

melat0nin
01-06-2010, 17:43
Quote Originally Posted by gregoryfenton
RewriteRule ^(.*)$ index.php/$1

surely you mean
RewriteRule ^(.*)$ index.php?$1

or even
RewriteRule ^(.*)$ index.php?param=$1

The way yours reads you are simply trying to read from file $1 in directory index.php
Thanks for the reply. Those don't work (it just shows the homepage no matter what link is clicked). The idea is to remove index.php - with URL rewriting turned off, page URLs look like this:

url.com/index.php (home, no index.php also works obviously)
url.com/index.php/about-us
url.com/index.php/contact us

etc

The idea is to get

url.com/ (home)
url.com/about-us
url.com/contact-us

gregoryfenton
31-05-2010, 22:39
RewriteRule ^(.*)$ index.php/$1

surely you mean
RewriteRule ^(.*)$ index.php?$1

or even
RewriteRule ^(.*)$ index.php?param=$1

The way yours reads you are simply trying to read from file $1 in directory index.php

Myatu
31-05-2010, 22:10
Have a read through this topic at Concrete5 (disclaimer: never used it myself, but thought this would be helpful to you): http://www.concrete5.org/community/f...write_problems

melat0nin
31-05-2010, 21:29
Anyone got any ideas?

melat0nin
28-05-2010, 12:16
Hi all

I'm developing a concrete5 site and am trying to set up URL rewriting, but I get the error 'No input file specified' whenever I try to access a rewritten URL.

The .htaccess file contains this (and nothing else):

HTML Code:

RewriteEngine On
RewriteBase /~scotlawc/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
I'm working on the OVH URL at the moment, not the domain (so r#####.ovh.net/~scotlawc/). I've played around with the RewriteBase line, but that didn't help.

Any thoughts? There are discussions on the French OVH forum about this issue but I don't know French and can't decipher the instructions there.