kpmedia Posted April 1, 2015 Report Posted April 1, 2015 This URL is terrible: http://site.com/client/plugin/support_manager/client_tickets/ This is not http://site.com/client/support/tickets/ Is there anyway to change this? I've never been an htaccess whiz, so not sure if that's all that's needed here. (Doubt it. But had to ask.) Quote
0 Michael Posted April 1, 2015 Report Posted April 1, 2015 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/ Quote
0 Nelsa Posted April 1, 2015 Report Posted April 1, 2015 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 Quote
0 kpmedia Posted April 2, 2015 Author Report Posted April 2, 2015 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. Quote
0 Nelsa Posted April 2, 2015 Report Posted April 2, 2015 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. Quote
0 Nelsa Posted April 2, 2015 Report Posted April 2, 2015 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 Quote
0 kpmedia Posted April 2, 2015 Author Report Posted April 2, 2015 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. Quote
0 Nelsa Posted April 3, 2015 Report Posted April 3, 2015 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] Quote
Question
kpmedia
This URL is terrible:
This is not
Is there anyway to change this?
I've never been an htaccess whiz, so not sure if that's all that's needed here. (Doubt it. But had to ask.)
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.