XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
Moderator: General Moderators
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Sun Dec 11, 2005 2:27 pm
Hey guys, heres my problem
Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^([A-Za-z]+).rtr$ index.php?page=$1
Very simple rule, I've been working with mod rewrite for some time but I am baffled. My current url is looking like
http://localhost/projects/runtings/artists.rtr
.htaccess is located in /runtings/
Of course changing artists to something else, anything else, even artists itself, results in a blank page. My index.php is not even loaded, so I do not know what do to from here.
Thank ye.
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Sun Dec 11, 2005 11:17 pm
Seems I had to add the futh path to the index, as it was grabbing the index.php in my root directory, not the current directory
Code: Select all
RewriteRule ^([A-Za-z]+)$ http://localhost/projects/runtings/index.php?page=$1
Previously when using mod_rewrite I've never had to do this, so can anyone offer insight, and possibly a way to avoid having to write the futh path?
redmonkey
Forum Regular
Posts: 836 Joined: Thu Dec 18, 2003 3:58 pm
Post
by redmonkey » Mon Dec 12, 2005 12:12 am
Probably due to the base directory being set as the document root of the webserver/virtual host
i.e...
.. means that any path specified will be from the ducoment root directory of the webserver/virtual host.
Your orginal rule would probably work fine with
redmonkey
Forum Regular
Posts: 836 Joined: Thu Dec 18, 2003 3:58 pm
Post
by redmonkey » Mon Dec 12, 2005 3:52 am
Which version of Apache are you running?
And where exactly is this .htaccess file within your directory structure?
This is a different .htaccess file from the original posted?