This is a discussion on Rewrite in short mode within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, i need to rewrite mysite.com/MyText in mysite.com/?page=MyText The real page is mysite.com/index....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi, i need to rewrite mysite.com/MyText in mysite.com/?page=MyText
The real page is mysite.com/index.php?page=MyText but if I use only ?page= it function correctly. My .htaccess is this Options +FollowSymLinks +Indexes +MultiViews RewriteEngine On RewriteRule ^/([a-z]) ?page=$1 [L] ErrorDocument 404 http://mysite/?page=Error ErrorDocument 403 http://mysite/?page=Error ErrorDocument 500 http://mysite/?page=Error ErrorDocument 401 http://mysite/?page=Error This code redirect all page in mysite.com/MyText form at mysite/?page=Error. What's the solution? Another question (the last): if I use ^/([a-z]) and the url is "mysite.com/My Text 2"... Thanks, Daniele |
|
|||
|
On Fri, 23 Feb 2007 02:34:39 +0100, Scream <danitag@infinito.it> wrote:
> Hi, i need to rewrite mysite.com/MyText in mysite.com/?page=MyText > > The real page is mysite.com/index.php?page=MyText but if I use only > ?page= it function correctly. > > My .htaccess is this > > Options +FollowSymLinks +Indexes +MultiViews > RewriteEngine On > RewriteRule ^/([a-z]) ?page=$1 [L] > ErrorDocument 404 http://mysite/?page=Error > ErrorDocument 403 http://mysite/?page=Error > ErrorDocument 500 http://mysite/?page=Error > ErrorDocument 401 http://mysite/?page=Error > > This code redirect all page in mysite.com/MyText form at > mysite/?page=Error. What's the solution? Afaik, you cannot simply say ?etc...., in .htaccess, you must specifiy the file. > Another question (the last): if I use ^/([a-z]) and the url is > "mysite.com/My Text 2"... It will redirect to http://mysite/?page=M, because you only capture the first character. I'd: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php page=$1 [L] -- Rik Wasmus |
|
|||
|
Rik schreef:
> On Fri, 23 Feb 2007 02:34:39 +0100, Scream <danitag@infinito.it> wrote: > >> Hi, i need to rewrite mysite.com/MyText in mysite.com/?page=MyText >> >> The real page is mysite.com/index.php?page=MyText but if I use only >> ?page= it function correctly. A bit OT but I read somewhere yahoo or google wont index this. Cant remember wich one it was and maybe it has changed but it seems a waste. -- Arjen http://www.hondenpage.com |