Please help me check this ".htaccess" code.

Started on the old forum in June 2010 · view the original in the archive · old links redirect here

#htaccess-error #modrewrite

7 replies · 533 views · started 16 years ago · 1 min read

4 participants
youngbobby Developer · 55 posts #1

For some reasons i don't understand, this .htaccess code is not working to my satisfaction. Someone please help me check and tell me whats wrong.

<IfModule mod_rewrite.c>
RewriteEngine On # Turn on the rewriting engine
RewriteBase /
#DO NOT EDIT THIS IF YOU ARE A NEWBIE!!!!!!!!!!!!!
RewriteRule ^register/([^-]+)$ http://site.net/Admin/register.php?catch=$1 [NC,L] # Handle requests for "REGISTER"
RewriteRule ^verify/([^-]+)/([^&]+)$ http://site.net/Admin/verifyAccount.php?catch=verify&un=$1&vcode=$2 [NC,L] # Handle requests for "VERIFICATION"
RewriteRule ^verify/$ http://site.net/Admin/verifyAccount.php?catch=verify&un=&vcode= [NC,L]
RewriteRule ^cats/$ http://site.net/Admin/index.php [NC,L]
</IfModule>

It directs fine but after that i still see url the way i don't want it to.

Thanks in advance.

Naijatop.net = Mobile Traffic Booster 👑

📖 YoungBobby.com = Bobby's BLoG 😁

You're Welcome !!

something else Fellow · 2,296 posts #4

I think you require:

Options +FollowSymLinks

i could be wrong tho 😛

djlee Developer · 224 posts #5

u dont have any redirects such as header("Location:") in the scripts your directing to do you that are sending teh users onto a non-seo friendly url ? only thing i can think of if the redirects themselves are working.

something else Fellow · 2,296 posts #7

youngbobby wrote: Urrrrm I don't quite understand. I have put up the code above on the .htaccess file and on my site, i link directly to the url like i've set it up on the .htaccess file or is that not the right way of doing it?

Along the Line, once Page Loads completely it still displays URL in an "Unfriendly Manner"

Example:

My .htaccess has this:

RewriteEngine On
RewriteBase /
RewriteRule ^categories/([0-9]+)/([0-9]+)/([A-Za-z0-9-]+)/?$ http://naijatop.net/Site/viewCategory.php?page=$1&id=$2&catname=$3 [L]
RewriteRule ^view/([0-9]+)/(.*)/?$ http://naijatop.net/Site/viewSiteDetails.php?id=$1&sitename=$2 [R]

Now my PHP code for viewSiteCategory.php:

$we = htmlspecialchars_decode(trim($hen[1]));
$deef = preg_replace('/[^A-Za-z0-9]/', '-', $we);
  echo " <b><a title=\"".$hen[1]."\" href=\"".$siteurl."/Site/view/".$hen[0]."/".$deef."/\">".GO."</a></b>

Is there anything i am missing?

Are You Putting .htaccess in your "Site" Folder or Main Directory ?

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close