.htaccess file mod rewrite in godaddy
i have a problem with .htaccess mod rewite in godaddy server.
i have .htaccess file like
# Options
Options -Multiviews
Options +FollowSymLinks
RewriteEngine on
RewriteRule index-hotel_in-(.*).htm$ index.php?hotel_in=$1
I have url like http://www.travelsetu.com/index.php?hotelsin=London.
I want url lie http://www.travelsetu.com/hotels-in-london.
what can i do? please help me out.
mod-rewrite
migrated from stackoverflow.com Mar 25 '13 at 12:17
This question came from our site for professional and enthusiast programmers.
add a comment |
i have a problem with .htaccess mod rewite in godaddy server.
i have .htaccess file like
# Options
Options -Multiviews
Options +FollowSymLinks
RewriteEngine on
RewriteRule index-hotel_in-(.*).htm$ index.php?hotel_in=$1
I have url like http://www.travelsetu.com/index.php?hotelsin=London.
I want url lie http://www.travelsetu.com/hotels-in-london.
what can i do? please help me out.
mod-rewrite
migrated from stackoverflow.com Mar 25 '13 at 12:17
This question came from our site for professional and enthusiast programmers.
add a comment |
i have a problem with .htaccess mod rewite in godaddy server.
i have .htaccess file like
# Options
Options -Multiviews
Options +FollowSymLinks
RewriteEngine on
RewriteRule index-hotel_in-(.*).htm$ index.php?hotel_in=$1
I have url like http://www.travelsetu.com/index.php?hotelsin=London.
I want url lie http://www.travelsetu.com/hotels-in-london.
what can i do? please help me out.
mod-rewrite
i have a problem with .htaccess mod rewite in godaddy server.
i have .htaccess file like
# Options
Options -Multiviews
Options +FollowSymLinks
RewriteEngine on
RewriteRule index-hotel_in-(.*).htm$ index.php?hotel_in=$1
I have url like http://www.travelsetu.com/index.php?hotelsin=London.
I want url lie http://www.travelsetu.com/hotels-in-london.
what can i do? please help me out.
mod-rewrite
mod-rewrite
edited Feb 10 '16 at 5:49
JakeGould
31.3k1096138
31.3k1096138
asked Mar 25 '13 at 9:13
jagu gajjarjagu gajjar
111
111
migrated from stackoverflow.com Mar 25 '13 at 12:17
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Mar 25 '13 at 12:17
This question came from our site for professional and enthusiast programmers.
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
Your rule will not match because you included the htm extension.
Try using the following code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^hotels-in-(.*)$ index.php?hotelsin=$1 [L,NC]
Please note that you have not fully clarified what the QUERY_STRING should really be. Is it hotel_in or hotelsin? Please amend my code above if it incorrect.
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error. my query string is hotelsin.....
– jagu gajjar
Mar 25 '13 at 12:22
I have edited the code to include escapes for the hyphens. Please give it a try.
– Mike Rockétt
Mar 25 '13 at 13:02
Hi,Thanks for your help, now i am getting static url like travelsetu.com/hotels-in-london but the problem is its not reflected on website, i am getting result on travelsetu.com/index.php?hotelsin=London this url too, its not redirecting( i got result using both urls , i want to hide dynamic url), and what can i do to get static url for page 2 (travelsetu.com/index.php?hotelsin=london&page=2) , page 3 (travelsetu.com/index.php?hotelsin=london&page=3) Thanks again for your help......
– jagu gajjar
Mar 26 '13 at 7:52
And what can i do for my hotel detail page url like this travelsetu.com/… i want url like this travelsetu.com/… Thanks a lot.....
– jagu gajjar
Mar 26 '13 at 7:57
add a comment |
THIS is the right way
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ /$1.php [L,QSA]
add a comment |
Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>
this way worked for me
add a comment |
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.travelsetu.com[nc]
RewriteRule ^hotels-in-(.*)$ http://www..travelsetu.com/index.php?hotelsin=$1 [L,nc]
Try this hope this helps
1
This is an incorrect answer. @jagu does not want to redirect, but wants a rewrite so that the URL looks friendly.
– Mike Anthony
Mar 25 '13 at 11:24
Okie.. in that case just remove [r=301,nc] to [L,nc] where [L] tells the server to stop trying to rewrite a URL after it has applied that rule.
– Siddhartha Gupta
Mar 25 '13 at 11:38
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error.
– jagu gajjar
Mar 25 '13 at 12:23
Please check if you have AllowOverride set to 'All' or 'FileInfo' in httpd.conf file for having permissions of mod_rewrite directives in .htaccess file. Also add first line : RewriteBase / in .htaccess file
– Siddhartha Gupta
Mar 25 '13 at 12:29
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your rule will not match because you included the htm extension.
Try using the following code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^hotels-in-(.*)$ index.php?hotelsin=$1 [L,NC]
Please note that you have not fully clarified what the QUERY_STRING should really be. Is it hotel_in or hotelsin? Please amend my code above if it incorrect.
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error. my query string is hotelsin.....
– jagu gajjar
Mar 25 '13 at 12:22
I have edited the code to include escapes for the hyphens. Please give it a try.
– Mike Rockétt
Mar 25 '13 at 13:02
Hi,Thanks for your help, now i am getting static url like travelsetu.com/hotels-in-london but the problem is its not reflected on website, i am getting result on travelsetu.com/index.php?hotelsin=London this url too, its not redirecting( i got result using both urls , i want to hide dynamic url), and what can i do to get static url for page 2 (travelsetu.com/index.php?hotelsin=london&page=2) , page 3 (travelsetu.com/index.php?hotelsin=london&page=3) Thanks again for your help......
– jagu gajjar
Mar 26 '13 at 7:52
And what can i do for my hotel detail page url like this travelsetu.com/… i want url like this travelsetu.com/… Thanks a lot.....
– jagu gajjar
Mar 26 '13 at 7:57
add a comment |
Your rule will not match because you included the htm extension.
Try using the following code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^hotels-in-(.*)$ index.php?hotelsin=$1 [L,NC]
Please note that you have not fully clarified what the QUERY_STRING should really be. Is it hotel_in or hotelsin? Please amend my code above if it incorrect.
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error. my query string is hotelsin.....
– jagu gajjar
Mar 25 '13 at 12:22
I have edited the code to include escapes for the hyphens. Please give it a try.
– Mike Rockétt
Mar 25 '13 at 13:02
Hi,Thanks for your help, now i am getting static url like travelsetu.com/hotels-in-london but the problem is its not reflected on website, i am getting result on travelsetu.com/index.php?hotelsin=London this url too, its not redirecting( i got result using both urls , i want to hide dynamic url), and what can i do to get static url for page 2 (travelsetu.com/index.php?hotelsin=london&page=2) , page 3 (travelsetu.com/index.php?hotelsin=london&page=3) Thanks again for your help......
– jagu gajjar
Mar 26 '13 at 7:52
And what can i do for my hotel detail page url like this travelsetu.com/… i want url like this travelsetu.com/… Thanks a lot.....
– jagu gajjar
Mar 26 '13 at 7:57
add a comment |
Your rule will not match because you included the htm extension.
Try using the following code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^hotels-in-(.*)$ index.php?hotelsin=$1 [L,NC]
Please note that you have not fully clarified what the QUERY_STRING should really be. Is it hotel_in or hotelsin? Please amend my code above if it incorrect.
Your rule will not match because you included the htm extension.
Try using the following code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^hotels-in-(.*)$ index.php?hotelsin=$1 [L,NC]
Please note that you have not fully clarified what the QUERY_STRING should really be. Is it hotel_in or hotelsin? Please amend my code above if it incorrect.
edited Mar 25 '13 at 13:00
answered Mar 25 '13 at 11:27
Mike RockéttMike Rockétt
1812420
1812420
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error. my query string is hotelsin.....
– jagu gajjar
Mar 25 '13 at 12:22
I have edited the code to include escapes for the hyphens. Please give it a try.
– Mike Rockétt
Mar 25 '13 at 13:02
Hi,Thanks for your help, now i am getting static url like travelsetu.com/hotels-in-london but the problem is its not reflected on website, i am getting result on travelsetu.com/index.php?hotelsin=London this url too, its not redirecting( i got result using both urls , i want to hide dynamic url), and what can i do to get static url for page 2 (travelsetu.com/index.php?hotelsin=london&page=2) , page 3 (travelsetu.com/index.php?hotelsin=london&page=3) Thanks again for your help......
– jagu gajjar
Mar 26 '13 at 7:52
And what can i do for my hotel detail page url like this travelsetu.com/… i want url like this travelsetu.com/… Thanks a lot.....
– jagu gajjar
Mar 26 '13 at 7:57
add a comment |
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error. my query string is hotelsin.....
– jagu gajjar
Mar 25 '13 at 12:22
I have edited the code to include escapes for the hyphens. Please give it a try.
– Mike Rockétt
Mar 25 '13 at 13:02
Hi,Thanks for your help, now i am getting static url like travelsetu.com/hotels-in-london but the problem is its not reflected on website, i am getting result on travelsetu.com/index.php?hotelsin=London this url too, its not redirecting( i got result using both urls , i want to hide dynamic url), and what can i do to get static url for page 2 (travelsetu.com/index.php?hotelsin=london&page=2) , page 3 (travelsetu.com/index.php?hotelsin=london&page=3) Thanks again for your help......
– jagu gajjar
Mar 26 '13 at 7:52
And what can i do for my hotel detail page url like this travelsetu.com/… i want url like this travelsetu.com/… Thanks a lot.....
– jagu gajjar
Mar 26 '13 at 7:57
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error. my query string is hotelsin.....
– jagu gajjar
Mar 25 '13 at 12:22
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error. my query string is hotelsin.....
– jagu gajjar
Mar 25 '13 at 12:22
I have edited the code to include escapes for the hyphens. Please give it a try.
– Mike Rockétt
Mar 25 '13 at 13:02
I have edited the code to include escapes for the hyphens. Please give it a try.
– Mike Rockétt
Mar 25 '13 at 13:02
Hi,Thanks for your help, now i am getting static url like travelsetu.com/hotels-in-london but the problem is its not reflected on website, i am getting result on travelsetu.com/index.php?hotelsin=London this url too, its not redirecting( i got result using both urls , i want to hide dynamic url), and what can i do to get static url for page 2 (travelsetu.com/index.php?hotelsin=london&page=2) , page 3 (travelsetu.com/index.php?hotelsin=london&page=3) Thanks again for your help......
– jagu gajjar
Mar 26 '13 at 7:52
Hi,Thanks for your help, now i am getting static url like travelsetu.com/hotels-in-london but the problem is its not reflected on website, i am getting result on travelsetu.com/index.php?hotelsin=London this url too, its not redirecting( i got result using both urls , i want to hide dynamic url), and what can i do to get static url for page 2 (travelsetu.com/index.php?hotelsin=london&page=2) , page 3 (travelsetu.com/index.php?hotelsin=london&page=3) Thanks again for your help......
– jagu gajjar
Mar 26 '13 at 7:52
And what can i do for my hotel detail page url like this travelsetu.com/… i want url like this travelsetu.com/… Thanks a lot.....
– jagu gajjar
Mar 26 '13 at 7:57
And what can i do for my hotel detail page url like this travelsetu.com/… i want url like this travelsetu.com/… Thanks a lot.....
– jagu gajjar
Mar 26 '13 at 7:57
add a comment |
THIS is the right way
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ /$1.php [L,QSA]
add a comment |
THIS is the right way
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ /$1.php [L,QSA]
add a comment |
THIS is the right way
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ /$1.php [L,QSA]
THIS is the right way
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ /$1.php [L,QSA]
edited Dec 13 '13 at 16:38
Andrea
1,43631316
1,43631316
answered Dec 13 '13 at 15:28
BhushanBhushan
11
11
add a comment |
add a comment |
Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>
this way worked for me
add a comment |
Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>
this way worked for me
add a comment |
Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>
this way worked for me
Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>
this way worked for me
edited Jan 7 '14 at 17:00
Andrew Schulman
2,53811618
2,53811618
answered Jan 7 '14 at 16:00
Rodrigo AlbernazRodrigo Albernaz
1
1
add a comment |
add a comment |
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.travelsetu.com[nc]
RewriteRule ^hotels-in-(.*)$ http://www..travelsetu.com/index.php?hotelsin=$1 [L,nc]
Try this hope this helps
1
This is an incorrect answer. @jagu does not want to redirect, but wants a rewrite so that the URL looks friendly.
– Mike Anthony
Mar 25 '13 at 11:24
Okie.. in that case just remove [r=301,nc] to [L,nc] where [L] tells the server to stop trying to rewrite a URL after it has applied that rule.
– Siddhartha Gupta
Mar 25 '13 at 11:38
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error.
– jagu gajjar
Mar 25 '13 at 12:23
Please check if you have AllowOverride set to 'All' or 'FileInfo' in httpd.conf file for having permissions of mod_rewrite directives in .htaccess file. Also add first line : RewriteBase / in .htaccess file
– Siddhartha Gupta
Mar 25 '13 at 12:29
add a comment |
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.travelsetu.com[nc]
RewriteRule ^hotels-in-(.*)$ http://www..travelsetu.com/index.php?hotelsin=$1 [L,nc]
Try this hope this helps
1
This is an incorrect answer. @jagu does not want to redirect, but wants a rewrite so that the URL looks friendly.
– Mike Anthony
Mar 25 '13 at 11:24
Okie.. in that case just remove [r=301,nc] to [L,nc] where [L] tells the server to stop trying to rewrite a URL after it has applied that rule.
– Siddhartha Gupta
Mar 25 '13 at 11:38
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error.
– jagu gajjar
Mar 25 '13 at 12:23
Please check if you have AllowOverride set to 'All' or 'FileInfo' in httpd.conf file for having permissions of mod_rewrite directives in .htaccess file. Also add first line : RewriteBase / in .htaccess file
– Siddhartha Gupta
Mar 25 '13 at 12:29
add a comment |
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.travelsetu.com[nc]
RewriteRule ^hotels-in-(.*)$ http://www..travelsetu.com/index.php?hotelsin=$1 [L,nc]
Try this hope this helps
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.travelsetu.com[nc]
RewriteRule ^hotels-in-(.*)$ http://www..travelsetu.com/index.php?hotelsin=$1 [L,nc]
Try this hope this helps
edited Feb 10 '16 at 5:50
JakeGould
31.3k1096138
31.3k1096138
answered Mar 25 '13 at 10:44
Siddhartha GuptaSiddhartha Gupta
101
101
1
This is an incorrect answer. @jagu does not want to redirect, but wants a rewrite so that the URL looks friendly.
– Mike Anthony
Mar 25 '13 at 11:24
Okie.. in that case just remove [r=301,nc] to [L,nc] where [L] tells the server to stop trying to rewrite a URL after it has applied that rule.
– Siddhartha Gupta
Mar 25 '13 at 11:38
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error.
– jagu gajjar
Mar 25 '13 at 12:23
Please check if you have AllowOverride set to 'All' or 'FileInfo' in httpd.conf file for having permissions of mod_rewrite directives in .htaccess file. Also add first line : RewriteBase / in .htaccess file
– Siddhartha Gupta
Mar 25 '13 at 12:29
add a comment |
1
This is an incorrect answer. @jagu does not want to redirect, but wants a rewrite so that the URL looks friendly.
– Mike Anthony
Mar 25 '13 at 11:24
Okie.. in that case just remove [r=301,nc] to [L,nc] where [L] tells the server to stop trying to rewrite a URL after it has applied that rule.
– Siddhartha Gupta
Mar 25 '13 at 11:38
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error.
– jagu gajjar
Mar 25 '13 at 12:23
Please check if you have AllowOverride set to 'All' or 'FileInfo' in httpd.conf file for having permissions of mod_rewrite directives in .htaccess file. Also add first line : RewriteBase / in .htaccess file
– Siddhartha Gupta
Mar 25 '13 at 12:29
1
1
This is an incorrect answer. @jagu does not want to redirect, but wants a rewrite so that the URL looks friendly.
– Mike Anthony
Mar 25 '13 at 11:24
This is an incorrect answer. @jagu does not want to redirect, but wants a rewrite so that the URL looks friendly.
– Mike Anthony
Mar 25 '13 at 11:24
Okie.. in that case just remove [r=301,nc] to [L,nc] where [L] tells the server to stop trying to rewrite a URL after it has applied that rule.
– Siddhartha Gupta
Mar 25 '13 at 11:38
Okie.. in that case just remove [r=301,nc] to [L,nc] where [L] tells the server to stop trying to rewrite a URL after it has applied that rule.
– Siddhartha Gupta
Mar 25 '13 at 11:38
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error.
– jagu gajjar
Mar 25 '13 at 12:23
Hi thanks for qucik responce i add your code in my .htaccess but its giving 500 internal server error.
– jagu gajjar
Mar 25 '13 at 12:23
Please check if you have AllowOverride set to 'All' or 'FileInfo' in httpd.conf file for having permissions of mod_rewrite directives in .htaccess file. Also add first line : RewriteBase / in .htaccess file
– Siddhartha Gupta
Mar 25 '13 at 12:29
Please check if you have AllowOverride set to 'All' or 'FileInfo' in httpd.conf file for having permissions of mod_rewrite directives in .htaccess file. Also add first line : RewriteBase / in .htaccess file
– Siddhartha Gupta
Mar 25 '13 at 12:29
add a comment |