Welcome to WebmasterWorld Guest from 54.146.201.80

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

seo friendly url issue using htaccess

     
7:38 pm on Jul 1, 2014 (gmt 0)

New User

joined:Dec 2, 2012
posts: 4
votes: 0


I am having a problem with htaccess.

My non seo friendly url looks like this

http://localhost/mybb/index.php?url=login/register


and the code is

Options -MultiViews
RewriteEngine On
RewriteBase /mybb/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]


And it returns
`http://localhost/mybb/login/register`
which is absolutely fine now I am trying to modify the url which will look like this

http://localhost/mybb/login/register/step/1


And the original url is

http://localhost/mybb/index.php?url=login/register&step=1


I tried with this

 RewriteRule ^(.+)$ index.php?url=$1&step=1$ [QSA,L]


it worked with the url which has step as param but if there is no 'step' in url then it doesn't work.Is it possible to add the /step/1 in the seo url only if the actual url contains the param called 'step'.Thanks.
10:41 am on July 17, 2014 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 15, 2004
posts:941
votes: 0


RewriteRule ^([^/]+)/step/([^/]+)/$ index.php?url=$1&step=$2 [NC,L]

This rule is close to what you look for BUT your two variables must have no / in them.
I cant offer more help, with the way your variables arr set (i mean with url='login/register', containing already a /)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members