1
votes

I'm currently using phpDolphin as my website social network, phpDolphin is not SEO URL ready, I was researching on how to fix the .htaccess for friendly seo urls and I cannot seem to deal with it. Here's my current .htaccess

Also here's how urls appear

http://feisbu.me/index.php?a=profile&u=cubaton3

and I want to show: http://feisbu.me/cubaton3

Here's my .htaccess file

RewriteEngine on
RewriteCond %{request_filename} -f
RewriteRule ^(.*) $1 [L]
RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$  index.php?a=$1&q=$3    [L]

Please help me, thanks.

2

2 Answers

1
votes

A few obvious things:

  • Mod_rewrite does not change the links you output. Your server side script needs to do that.
  • Your conditions and rules are kind of a mess, and you clearly need to hardwire your a=profile parameter. Remember that you're matching on, and rewriting the query string unless you specifically are using hostname variables, but they should not be relevant to matching, and are not part of the rewriting process unless you're issuing 301's.

This is typically done with something like this:

 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-l                                                                                                                                                                              
 RewriteRule ^/(.*)$ /index.php?a=profile&q=$1 [L,QSA]

I'm not familiar with phpDolphin or other routes that this might interfere with, so you will probably need other rules. I personally am not a fan of these "if nothing default route to users" type of setups. Something like "/user/name" would be a cleaner route that will not interfere with other routes, since you can exact match on the parameters.

0
votes

This is the solution, hope I helped, my site is gofinder.org:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/.]+)/?$ index.php?a=profile&u=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L,QSA]