Jump to content

SEF newbie: if i type the link in url it redirects correctly -- but if..


antonyfal

Recommended Posts

Hi, im just figuring out the mod rewrite and htaccess files, im getting a good handle on it, but i have the strange issue: firstly i cant use the

Options +FollowSymlinks  im guessing its because the server has it enabled by default..

 

secondly i can type the sef url in the browser and it shows the correct page/s.. but if i click the link (original) on the site or type the originalurl in the address bar, the SEF url doesnt show..

 

is there a method for redirecting to sef url that i am missing?

 

this is what i got so far:

 

RewriteEngine  on

#RewriteBase /folder1/folder2/

#RewriteCond %{SERVER_PORT} !^443$

#RewriteRule ^(.*)$ https://www.xxxxxx.com/$1 [R=permanent]

 

RewriteRule ^logout.html$ index.php?a=k&jsat=log_out

RewriteRule ^login.html$ index.php?a=k&jsat=login_form

RewriteRule ^profile.html$ index.php?a=k

 

RewriteRule ^preview.html$ index.php?a=k&task=preview

#RewriteCond %{THE_REQUEST} ^GET\ /folder2/

#RewriteRule ^newfolder2/(.*) /folder2/$1 [L,R=301]

Link to comment
Share on other sites

I'm not entirely sure I understand your problem.  Clear cut examples would help.  Generally speaking however, "Redirects" and "rewrites" are 2 different things.  From your list, you have no active redirection rules -- only rewrites.  The 4 rewrites you have are pretty clear cut:

 

RewriteRule ^logout.html$ index.php?a=k&jsat=log_out
RewriteRule ^login.html$ index.php?a=k&jsat=login_form
RewriteRule ^profile.html$ index.php?a=k
RewriteRule ^preview.html$ index.php?a=k&task=preview

 

Could you provide a specific example of what is not working in regards to these rules?

Link to comment
Share on other sites

Hi thanks for the reply..

After reading what you wrote-- i think what im needing/wanting is to redirect the original url to the sef url-- for example:

 

RewriteRule ^preview.html$ index.php?a=k&task=preview

 

if i type: www.xxx.com/folder1/folder2/preview.html  in the adressbar it works and takes me to the www.xxx.com/folder1/folder2/index.php?a=k&task=preview  page..

 

but how do i get it to do the reverse:

 

what i want to do is always have the SEF url diaplyed in the address bar:

 

so if i type/or click the link:  www.xxx.com/folder1/folder2/index.php?a=k&task=preview it must show the www.xxx.com/folder1/folder2/preview.html  the sef url in the address bar and go to the www.xxx.com/folder1/folder2/index.php?a=k&task=preview page..

 

whats happening now is: if i type the www.xxx.com/folder1/folder2/index.php?a=k&task=preview the url remains so, and the page loads i just want it to change to the SEF url first

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.