Jump to content
  • 0

Htaccess To Change Urls?


kpmedia

Question

7 answers to this question

Recommended Posts

  • 0

You can use the routes.php but I've not got experience messing with getting routes to work my way:

 

See: http://www.blesta.com/forums/index.php?/topic/1733-short-order-routes/

 

Perhaps give an example of what you mean, with the URL from my first post.

 

 

Yes you can use .htaccess to rewrite urls but don't forget to add conditions rules first, otherwise if you just add rewrite rules you will get internal server error every time

 

Perhaps give an example of what you mean, with the URL from my first post.

Link to comment
Share on other sites

  • 0

Well with conditions rules(RewriteCond) we tells that we will going to redirect rewrited url only to the paths that actualy don't exist ,otherwise without conditions rules it will just redirect rewrited url which will couse sever error,also with RewriteCond you can add rules to exclude files with some flags...etc,when you want to catch all urls with some variables and rewrite it than mostly you must add and some conditions rules,I will put some examples for you ,I need just to finish some tasks on my site,maybe for 30-60 minutes.

Link to comment
Share on other sites

  • 0

Perhaps give an example of what you mean, with the URL from my first post.

 

 

 

Perhaps give an example of what you mean, with the URL from my first post.

To rewrite just url from your post you shoud add this line to .htaccess

 

RewriteRule ^client/support/tickets/$ /client/plugin/support_manager/client_tickets/ [L]

 

You can also use solution to rewrite folders

RewriteRule ^support_manager/(.*) support/$1



			
		
Link to comment
Share on other sites

  • 0

Now the question is -- will this alter the address bar as well.

Because that's the end goal.

 

I'm still not understanding what you're saying about using a RewriteCond.

Your example didn't have one.

There is no new rewriteCond rule because to rewritte just one url you don't need new RewriteCond rule  and since  .htacces in blesta has few rewriteCond rules by default I just put one line.When I mention condition rule I tought you want rewrite all urls with some simbols to new urls and this is easyer to do  by combining RewriteRule and RewriteCond,

 

With code from example whole.htaccess in blesta shoud look  like this 


<Files ~ "\.(pdt)$">
   order deny,allow
   deny from all
</Files>

# Protect against Clickjacking
#Header append X-Frame-Options "SAMEORIGIN"

RewriteEngine on

# Force HTTPS
#RewriteCond %{HTTPS} !=on
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php

RewriteCond %{REQUEST_URI} ^(.*)/install.php$
RewriteRule install.php %1/install/ [R=301,L]

RewriteRule ^client/support/tickets/$ /client/plugin/support_manager/client_tickets/ [L]
Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...