homepage Welcome to WebmasterWorld Guest from 23.23.22.200
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
seo friendly url issue using htaccess
prithviphp




msg:4684220
 7:38 pm on Jul 1, 2014 (gmt 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.

 

omoutop




msg:4688387
 10:41 am on Jul 17, 2014 (gmt 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 /)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved