Simple Issue.

New to mod_rewrite? This is a good place to start.

Simple Issue.

Postby miguel » Tue Sep 15, 2009 1:56 pm

I know this is supposedly simple I just can't get any of the samples edited to work for me correctly, I've been at this for about 4 hrs now, I'd appreciate any help anyone could give.

So the root has something in it already ( a unrelated script ), and in this "at" folder there is the index.php that I want to use with the "clean url" folder as a variable.

so I want:

http://www.domain.com/at/random_foldername/

To redirect to:

http://www.domain.com/at/index.php?var= ... foldername

Cheers!

-Miguel
miguel
 
Posts: 2
Joined: Tue Sep 15, 2009 1:37 pm

Postby richardk » Tue Sep 15, 2009 6:04 pm

In a .htaccess file in /at
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]+)/?$ ./index.php?var=$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby miguel » Tue Sep 15, 2009 6:38 pm

Thank you so much richard! You rock.
miguel
 
Posts: 2
Joined: Tue Sep 15, 2009 1:37 pm


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 10 guests

cron