Joomla/htaccess : redirect index.php?start=[0-9] to / without breaking pagination elsewhere
up vote
0
down vote
favorite
I would like to redirect pagination of my Joomla homepage from https://example.com/index.php?start=5 to the root (https://example.com/) without impacting other pagination in website (ie: https://example.com/news.html?start=5 or https://example.com/categories.html?start=5).
I am able to redirect the https://example.com/?start=5 to https://example.com/ without impacting the rest of the pagination of the site with the following rule:
RewriteCond %QUERY_STRING ^start=([0-9]*)$ [NC]
RewriteRule ^$ https://example.com/$1? [R=301,L]
However it is impossible for me to redirect with the inclusion of index.php (https://example.com/index.php?start=5) without impacting the rest of the pagination of the site. I tried with the following rule:
RewriteCond %REQUEST_URI ^/index.php$
RewriteCond %QUERY_STRING ^start=(.*)$
RewriteRule ^index.php$ https://example.com/ [R=301,L]
but this impacts the rest of the pagination of the site like https://example.com/news.html?start=5 redirect to /.
Do you have any idea to do this kind of redirect ?
Here is my curent .htaccess :
IndexIgnore *
## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes
## Mod_rewrite in use.
RewriteEngine On
## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %QUERY_STRING base64_encode[^(]*([^)]*) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %QUERY_STRING (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %QUERY_STRING GLOBALS(=|[|%[0-9A-Z]0,2) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %QUERY_STRING _REQUEST(=|[|%[0-9A-Z]0,2)
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.
## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## Redirect index.php to https root ###############################
RewriteCond %THE_REQUEST !^POST
RewriteCond %THE_REQUEST ^[A-Z]3,9 /index.php HTTP/
RewriteCond %SERVER_PORT>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^index.php$ https://%HTTP_HOST/ [R=301,L]
###################################################################
## End ############## Utiliser "http%2://" pour http & https ######
## Rewrite (http & https)
RewriteCond %HTTP_HOST#%HTTPSs ^www.([^#]+)#(?:off|on(s)) [NC]
RewriteRule ^ https://%1%REQUEST_URI [R=301,L]
###################################################################
## End ############## Utiliser "http%2://" pour http & https ######
RewriteCond %QUERY_STRING ^start=([0-9]*)$ [NC]
RewriteRule ^$ https://%HTTP_HOST/$1? [R=301,NE,NC,L]
# RewriteBase /
## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%HTTP:Authorization]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %REQUEST_URI !^/index.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %REQUEST_FILENAME !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %REQUEST_FILENAME !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - core SEF Section.
## FORCE HTTPS ######################################################
RewriteCond %HTTPS OFF
RewriteRule (.*) https://%HTTP_HOST%REQUEST_URI [R=301,L]
#####################################################################
apache .htaccess redirect mod-rewrite joomla
add a comment |
up vote
0
down vote
favorite
I would like to redirect pagination of my Joomla homepage from https://example.com/index.php?start=5 to the root (https://example.com/) without impacting other pagination in website (ie: https://example.com/news.html?start=5 or https://example.com/categories.html?start=5).
I am able to redirect the https://example.com/?start=5 to https://example.com/ without impacting the rest of the pagination of the site with the following rule:
RewriteCond %QUERY_STRING ^start=([0-9]*)$ [NC]
RewriteRule ^$ https://example.com/$1? [R=301,L]
However it is impossible for me to redirect with the inclusion of index.php (https://example.com/index.php?start=5) without impacting the rest of the pagination of the site. I tried with the following rule:
RewriteCond %REQUEST_URI ^/index.php$
RewriteCond %QUERY_STRING ^start=(.*)$
RewriteRule ^index.php$ https://example.com/ [R=301,L]
but this impacts the rest of the pagination of the site like https://example.com/news.html?start=5 redirect to /.
Do you have any idea to do this kind of redirect ?
Here is my curent .htaccess :
IndexIgnore *
## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes
## Mod_rewrite in use.
RewriteEngine On
## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %QUERY_STRING base64_encode[^(]*([^)]*) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %QUERY_STRING (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %QUERY_STRING GLOBALS(=|[|%[0-9A-Z]0,2) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %QUERY_STRING _REQUEST(=|[|%[0-9A-Z]0,2)
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.
## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## Redirect index.php to https root ###############################
RewriteCond %THE_REQUEST !^POST
RewriteCond %THE_REQUEST ^[A-Z]3,9 /index.php HTTP/
RewriteCond %SERVER_PORT>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^index.php$ https://%HTTP_HOST/ [R=301,L]
###################################################################
## End ############## Utiliser "http%2://" pour http & https ######
## Rewrite (http & https)
RewriteCond %HTTP_HOST#%HTTPSs ^www.([^#]+)#(?:off|on(s)) [NC]
RewriteRule ^ https://%1%REQUEST_URI [R=301,L]
###################################################################
## End ############## Utiliser "http%2://" pour http & https ######
RewriteCond %QUERY_STRING ^start=([0-9]*)$ [NC]
RewriteRule ^$ https://%HTTP_HOST/$1? [R=301,NE,NC,L]
# RewriteBase /
## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%HTTP:Authorization]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %REQUEST_URI !^/index.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %REQUEST_FILENAME !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %REQUEST_FILENAME !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - core SEF Section.
## FORCE HTTPS ######################################################
RewriteCond %HTTPS OFF
RewriteRule (.*) https://%HTTP_HOST%REQUEST_URI [R=301,L]
#####################################################################
apache .htaccess redirect mod-rewrite joomla
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I would like to redirect pagination of my Joomla homepage from https://example.com/index.php?start=5 to the root (https://example.com/) without impacting other pagination in website (ie: https://example.com/news.html?start=5 or https://example.com/categories.html?start=5).
I am able to redirect the https://example.com/?start=5 to https://example.com/ without impacting the rest of the pagination of the site with the following rule:
RewriteCond %QUERY_STRING ^start=([0-9]*)$ [NC]
RewriteRule ^$ https://example.com/$1? [R=301,L]
However it is impossible for me to redirect with the inclusion of index.php (https://example.com/index.php?start=5) without impacting the rest of the pagination of the site. I tried with the following rule:
RewriteCond %REQUEST_URI ^/index.php$
RewriteCond %QUERY_STRING ^start=(.*)$
RewriteRule ^index.php$ https://example.com/ [R=301,L]
but this impacts the rest of the pagination of the site like https://example.com/news.html?start=5 redirect to /.
Do you have any idea to do this kind of redirect ?
Here is my curent .htaccess :
IndexIgnore *
## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes
## Mod_rewrite in use.
RewriteEngine On
## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %QUERY_STRING base64_encode[^(]*([^)]*) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %QUERY_STRING (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %QUERY_STRING GLOBALS(=|[|%[0-9A-Z]0,2) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %QUERY_STRING _REQUEST(=|[|%[0-9A-Z]0,2)
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.
## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## Redirect index.php to https root ###############################
RewriteCond %THE_REQUEST !^POST
RewriteCond %THE_REQUEST ^[A-Z]3,9 /index.php HTTP/
RewriteCond %SERVER_PORT>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^index.php$ https://%HTTP_HOST/ [R=301,L]
###################################################################
## End ############## Utiliser "http%2://" pour http & https ######
## Rewrite (http & https)
RewriteCond %HTTP_HOST#%HTTPSs ^www.([^#]+)#(?:off|on(s)) [NC]
RewriteRule ^ https://%1%REQUEST_URI [R=301,L]
###################################################################
## End ############## Utiliser "http%2://" pour http & https ######
RewriteCond %QUERY_STRING ^start=([0-9]*)$ [NC]
RewriteRule ^$ https://%HTTP_HOST/$1? [R=301,NE,NC,L]
# RewriteBase /
## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%HTTP:Authorization]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %REQUEST_URI !^/index.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %REQUEST_FILENAME !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %REQUEST_FILENAME !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - core SEF Section.
## FORCE HTTPS ######################################################
RewriteCond %HTTPS OFF
RewriteRule (.*) https://%HTTP_HOST%REQUEST_URI [R=301,L]
#####################################################################
apache .htaccess redirect mod-rewrite joomla
I would like to redirect pagination of my Joomla homepage from https://example.com/index.php?start=5 to the root (https://example.com/) without impacting other pagination in website (ie: https://example.com/news.html?start=5 or https://example.com/categories.html?start=5).
I am able to redirect the https://example.com/?start=5 to https://example.com/ without impacting the rest of the pagination of the site with the following rule:
RewriteCond %QUERY_STRING ^start=([0-9]*)$ [NC]
RewriteRule ^$ https://example.com/$1? [R=301,L]
However it is impossible for me to redirect with the inclusion of index.php (https://example.com/index.php?start=5) without impacting the rest of the pagination of the site. I tried with the following rule:
RewriteCond %REQUEST_URI ^/index.php$
RewriteCond %QUERY_STRING ^start=(.*)$
RewriteRule ^index.php$ https://example.com/ [R=301,L]
but this impacts the rest of the pagination of the site like https://example.com/news.html?start=5 redirect to /.
Do you have any idea to do this kind of redirect ?
Here is my curent .htaccess :
IndexIgnore *
## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes
## Mod_rewrite in use.
RewriteEngine On
## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %QUERY_STRING base64_encode[^(]*([^)]*) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %QUERY_STRING (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %QUERY_STRING GLOBALS(=|[|%[0-9A-Z]0,2) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %QUERY_STRING _REQUEST(=|[|%[0-9A-Z]0,2)
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.
## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## Redirect index.php to https root ###############################
RewriteCond %THE_REQUEST !^POST
RewriteCond %THE_REQUEST ^[A-Z]3,9 /index.php HTTP/
RewriteCond %SERVER_PORT>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^index.php$ https://%HTTP_HOST/ [R=301,L]
###################################################################
## End ############## Utiliser "http%2://" pour http & https ######
## Rewrite (http & https)
RewriteCond %HTTP_HOST#%HTTPSs ^www.([^#]+)#(?:off|on(s)) [NC]
RewriteRule ^ https://%1%REQUEST_URI [R=301,L]
###################################################################
## End ############## Utiliser "http%2://" pour http & https ######
RewriteCond %QUERY_STRING ^start=([0-9]*)$ [NC]
RewriteRule ^$ https://%HTTP_HOST/$1? [R=301,NE,NC,L]
# RewriteBase /
## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%HTTP:Authorization]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %REQUEST_URI !^/index.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %REQUEST_FILENAME !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %REQUEST_FILENAME !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - core SEF Section.
## FORCE HTTPS ######################################################
RewriteCond %HTTPS OFF
RewriteRule (.*) https://%HTTP_HOST%REQUEST_URI [R=301,L]
#####################################################################
apache .htaccess redirect mod-rewrite joomla
apache .htaccess redirect mod-rewrite joomla
asked Nov 10 at 15:19
fornever
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240353%2fjoomla-htaccess-redirect-index-phpstart-0-9-to-without-breaking-paginatio%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown