Forum Moderators: phranque
FOR USERPROFILES:
->http://www.site.com/username or [site.com...]
will be redirected to or equivalent to :
->http://www.site.com/memberlist.php?mode=viewprofile&un=username
FOR USER CLANS:
->http://www.site.com/clan/clanname or [site.com...]
will be redirected to or equivalent to :
->http://rakista.com/clan_page.php?cn=clanname
Any help will be greatly appreciated. Thanks in advance!
Then post your best-effort code for discussion [webmasterworld.com].
Jim
Based on my readings, i comeup with this script?
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ /memberlist.php?mode=viewprofile&un=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^clan/([^/]+)/?$ /clan_page.php?cn==$1 [L]
I'm also thinking if "Options +Followsymlinks" is required to add in the script. Any thoughts?
Thanks
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
<IfModule mod_rewrite.c>
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ /memberlist.php?mode=viewprofile&un=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^clan/([^/]+)/?$ /clan_page.php?cn==$1 [L]
</IfModule>
I got this error when accessing a url like site.com/username
Not Found
The requested URL /ridz was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
You may wish to make the trailing slash optional in the first rule pattern, as you did in the second.
Somewhere (perhaps using cPanel) you have declared a custom 404 error document, but that document does not exist. You should create a custom 404 error page, somewhat apologetic in tone, explaining that the requested URL is missing for unknown reasons, and provide links to your home page, your site map, a product category selector, and your site search facility, as appropriate.
It is also sometimes useful to include a meta-refresh on that error page, leaving more than enough time for the visitor to read the entire page and select a link, and then refresh to whichever of the above-listed pages you feel is most appropriate. Do NOT use a short-period meta-refresh, or you will have trouble with search engines treating it as a redirect.
You can override the previous error document declaration (from cPanel?) in your .htaccess file if you wish, using a directive of the form:
ErrorDocument 404 /local-path-to-your-custom-404-error-page.html
Jim
i'm testing it first on the user profiles URLs.. www.site.com/username or site.com/username and it still doesnt work..
add slash before clan like this?
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ /memberlist.php?mode=viewprofile&un=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/clan/([^/]+)/?$ /clan_page.php?cn==$1 [L]
If you have questions about regular expressions, please review the regular expressions tutorial cited in our forum charter.
Jim