Need help with RewriteRule
Hello,
I have a. .htacces file with the following rule:
PHP Code:
RewriteRule ^([ A - Z ]{ 5 })$ dir / myfile . inc . php ? profile =$ 1 [ L ]
What it does is checks the URL and if the link looks like:
http://domain.com/ABCDE it takes the last part of the URL and redirects to the dir/myfile.inc.php.
I need to modify RewriteRule to add additional parameters to it but make it work as it does now. For example,
Basically keep additional params for the sake of SEO but keep the functionality as is.
Not sure how to do this...
([A-Z]{5}) can become ([a-zA-Z0-9_-/]+), which would catch letters, numbers, underscores, hyphens, and slashes. Which would make $_GET['profile'] = 'ABCDE/additional/parameter' in your example and would need to be split() accordingly.
Or can do something like this:
Code:
^([A-Z]{5})/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)[\/]$ dir/myfile.inc.php?profile=$1&addition=$2¶meter=$3 [L]
Mullanaphy!
http://www.mullanaphy.com/
Unless code is provided or an exact example is requested I think I'm going to start using psuedo code from now on...
Also, I freelance as well. Inquire within!
Ah, great.
What if I only need the first value to be all CAPS, 5 chars in length and the rest of the parameters are there just for the sake of SEO. Do I need to do anything with the flags?
If you only need the first flag:
Code:
^([A-Z]{5})(.*)$ dir/myfile.inc.php?profile=$1&
Mullanaphy!
http://www.mullanaphy.com/
Unless code is provided or an exact example is requested I think I'm going to start using psuedo code from now on...
Also, I freelance as well. Inquire within!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks