Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   This topic is locked: you cannot edit posts or make replies.
Author Message
Faytal
Newbie
Newbie



Joined: Feb 21, 2012
Posts: 60

PostPosted: Tue Jul 03, 2012 12:22 pm Reply with quote

Ok, so I've modified my .htaccess rewrite for "Your Account" FROM this:

Code:
#Your Account
RewriteRule ^userinfo-([a-zA-Z0-9_-]*).html modules.php?name=Your_Account&op=userinfo&username=$1 [L]


TO this:

Code:
#Your Account
RewriteRule ^([a-zA-Z0-9_-]*) modules.php?name=Your_Account&op=userinfo&username=$1 [L]


In an attempt to locate my user's Your Account page at

http://mysite.com/{user's_username}

(without a .html extension at the end)

So, when I go to the url http://mysite.com/{myusername}, which in this case will be "Johnneh", so, again, I would go to http://mysite.com/Johnneh

^And I would want THAT to be in replacement of the "userinfo-Johnneh.html" link. But, when I go to this: http://mysite.com/Johnneh
The Your Account page loads up for the account I type in place of the {username}. So, http://mysite.com/{username} would load the Your Account page, but it would load it in a weird way. It would look "put of structure", I'm guessing it's because the .html extension is missing, so it is displaying the page in a "plain text" format, but the links still appear. I will add a screenshot later. Is there any way to successfully do what I am trying to attempt? I've tried to add a rewrite at the top of all of the rewrites without changing the Your Account rewrite, so that I can rewrite the original shortlinks rewrite of "userinfo-([a-zA-Z0-9_-]*).html" to just "([a-zA-Z0-9_-]*)". This is what I tried:

Code:
RewriteRule ^([a-zA-Z0-9_-]*) userinfo-([a-zA-Z0-9_-]*).html


But still, it did not work..
 
View user's profile Send private message
Faytal
Newbie
Newbie



Joined: Feb 21, 2012
Posts: 60

PostPosted: Tue Jul 03, 2012 12:32 pm Reply with quote

Also, is there a way to include the user's username in the "title" of their Account page (of the Your_Account module)?

So, if someone was to go to: "http://montegoscripts.com/userinfo-montego.html", in the title of the page, at the top, on the "tab" for example, in Google Chrome, above the URL box, it would say "Your_Account-Home of the". Is there a way to make that say "Montego-Account"?
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Jul 03, 2012 7:20 pm Reply with quote

Johnneh,

This is an interesting idea. I like your idea of putting this right up top of the rewrites. Try this:

Code:

RewriteRule ^([a-zA-Z0-9_-]*)$ modules.php?name=Your_Account&op=userinfo&username=$1 [L] 


Note the only change I made was force the end-of-line marker ($). Not sure if it will work, but it is worth a try.

Regarding your additional topic (I don't usually like having multiple topics buried into one thread, but we'll run with it), need to understand what CMS / version you are running? Really needing to know if you are using a newer RavenNuke(tm) that has the Dynamic Header (DH) feature from nukeSEO or whether you are possibly using my Dynamic Titles hack???
 
View user's profile Send private message Visit poster's website
Faytal
Newbie
Newbie



Joined: Feb 21, 2012
Posts: 60

PostPosted: Tue Jul 03, 2012 9:04 pm Reply with quote

montego wrote:
Johnneh,

This is an interesting idea. I like your idea of putting this right up top of the rewrites. Try this:

Code:

RewriteRule ^([a-zA-Z0-9_-]*)$ modules.php?name=Your_Account&op=userinfo&username=$1 [L] 


Note the only change I made was force the end-of-line marker ($). Not sure if it will work, but it is worth a try.

Regarding your additional topic (I don't usually like having multiple topics buried into one thread, but we'll run with it), need to understand what CMS / version you are running? Really needing to know if you are using a newer RavenNuke(tm) that has the Dynamic Header (DH) feature from nukeSEO or whether you are possibly using my Dynamic Titles hack???
Thanks for your response. Well, maybe your Dynamic Titles hack/mod would help. I'll look into it. I'm running RavenNuke 2.50.00.
Also, the rewrite code worked. i can now reach my user's Your Account page by going to mysite.com/{username}, but, when I go to my homepage, I get a user not found error.

picture:
http://ttgdime.com/dimegrab/images/6e8026.png

Is there a way to fix this so I can access my home page without /index.html or /index.php?
 
View user's profile Send private message
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Wed Jul 04, 2012 7:30 pm Reply with quote

Sorry, i tried this code but it is not working

Quote:
RewriteRule ^([a-zA-Z0-9_-]*)$ modules.php?name=Your_Account&op=userinfo&username=$1 [L]
 
View user's profile Send private message Visit poster's website
Faytal
Newbie
Newbie



Joined: Feb 21, 2012
Posts: 60

PostPosted: Thu Jul 05, 2012 11:33 am Reply with quote

hicux wrote:
Sorry, i tried this code but it is not working

Quote:
RewriteRule ^([a-zA-Z0-9_-]*)$ modules.php?name=Your_Account&op=userinfo&username=$1 [L]

Make sure to place that code below RewriteEngine on, and above all of the other rewrites. So, place it above the index.php rewrite.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu Jul 05, 2012 6:54 pm Reply with quote

Johnneh, are you saying that it worked for you on your site?

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Faytal
Newbie
Newbie



Joined: Feb 21, 2012
Posts: 60

PostPosted: Thu Jul 05, 2012 10:59 pm Reply with quote

montego wrote:
Johnneh, are you saying that it worked for you on your site?
Yes, Montego. It worked perfectly! But, my question of the homepage thing above still remains.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Fri Jul 06, 2012 8:52 am Reply with quote

Oooppss... yes, this would impose a problem. We'll need to figure out how to fail the "null" condition...

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Faytal
Newbie
Newbie



Joined: Feb 21, 2012
Posts: 60

PostPosted: Fri Jul 06, 2012 1:25 pm Reply with quote

montego wrote:
Oooppss... yes, this would impose a problem. We'll need to figure out how to fail the "null" condition...
Until this is figured out, I have added this code above all of the rewrites:

Code:
RedirectMatch ^/$ /index.html


And, with that code, when mysite.com is requested, it redirects to mysite.com/index.html
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Fri Jul 06, 2012 1:57 pm Reply with quote

Please try commenting out your additional RedirectMatch and then changing the "*" to "+" as it will force at least one character to be present. Like this:

Code:

RewriteRule ^([a-zA-Z0-9_-]+)$ modules.php?name=Your_Account&op=userinfo&username=$1 [L]

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Faytal
Newbie
Newbie



Joined: Feb 21, 2012
Posts: 60

PostPosted: Sat Jul 07, 2012 1:08 am Reply with quote

montego wrote:
Please try commenting out your additional RedirectMatch and then changing the "*" to "+" as it will force at least one character to be present. Like this:

Code:

RewriteRule ^([a-zA-Z0-9_-]+)$ modules.php?name=Your_Account&op=userinfo&username=$1 [L]
Yep. That worked perfectly. Many thanks, Montego.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sun Jul 08, 2012 10:40 am Reply with quote

Hey, great to hear!

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Mon Jul 09, 2012 5:31 am Reply with quote

I get an error 404

Hint: Verify that the file exists - Filenames are usually case sensitive - Check for spelling errors.

What could be the problem guys? Please post examples, I just place it above but I want to be sure how you place it there. Shocked
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Jul 10, 2012 7:56 am Reply with quote

Johnneh wrote:
Make sure to place that code below RewriteEngine on, and above all of the other rewrites. So, place it above the index.php rewrite.


Hicux,

You won't get a 404 error if you place my last posted rewrite line where Jonneh has said in his post. Only add my one line. Do not add his additional RedirectMatch line as it is not needed.
 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   This topic is locked: you cannot edit posts or make replies.

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch